jsuske


Joined 1 year ago
Homeworks submitted:
Homework comments:
2
0

About Me

No description provided.

Classes

MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming

Class status: Established
Role: Student
. 11% complete

Submitted Assignments

MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming: Lesson 2, HW 1

Assignment 1 parts a and b

Part A

y = 1
z = 3
while (y < 1000):
    x = z/2
    while (x > 1):
        if z % x == 0:
            z = z + 2
            x = z / 2
        else: x = x - 1
    y = y + 1
    z = z + 2
print z - 2

Part B

import math
x = 3
y = 1
z = int (raw_input("Please Enter a Number"))
u = math.log(2)
while x < z:
    v = 3
    while (v < math.sqrt(x) and x%v <> 0):
        v = v + 2
    if v > math.sqrt(x):
        u = u + math.log(x)
    x = x + 2
print u
print x
w = u / x
print w

jsuske 1 year ago
MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming: Lesson 1, HW 1

Assignment 1

lastName = raw_input("Whats your last name?")
firstName = raw_input ("Whats your first name?")
print firstName, lastName

jsuske 1 year ago