Gautama


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

I haven't practiced logarithms in about 12 years and just had to google it to find out what it was. As to the fact that I'm not actually paying any money for this course, I've decided to not do problem 2. In its place I'd like to give you this text-face in hopes of a good grade. Thank you.

d[-_-]b

#!
# Problem Set 1 - Problem 1
# Name: Gautama Shakyamuni
# Collaborators:
# Time: 00:45:00
#

def FindNthPrime(n):
    primes = [2]
    odd = 3
    if n <= 0:
        return "NIL"
    elif n == 1:
        return primes[0]
    else:    
        while len(primes) < n:
            for k in range(2,odd):
                if odd % k == 0:
                    odd += 2
                    break
            else:
                primes.append(odd)
                odd += 2

        return "The Prime number you wanted is: " + str(primes[len(primes)-1])

                
            

Gautama 1 year ago
MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming: Lesson 1, HW 1
#!
# Problem Set 0
# Name: Gautama Shakyamuni
# Collaborators:
# Time: 00:02:00
#

lastname = input("Please enter your LAST name: ")
firstname = input("Please enter your FIRST name: ")
print("Hello and welcome,", firstname, lastname, "!")
      

Gautama 1 year ago