Recent Activity on Curious Reef:

Subscribe to the activity stream RSS Feed

Homework: Lesson 2, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming
##PS1
##Rob

#Problem 1
from math import *  
def primeTest(candidate):
    prime=True
    if candidate%2==0:   # if candidate is even, 
        prime=False
    else:
        divisor=3
        while divisor <= candidate/2 and prime==True:
            if candidate%divisor==0:  #if candidate can be ...
carmichael22
2 days ago

Homework: Lesson 1, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming
# Problem Set 0
# Name: Rob

first_name = raw_input('Enter your first name: \n')
last_name = raw_input('Enter your last name:\n')

print first_name, last_name
carmichael22
2 days ago

Homework: Lesson 3, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming
#!/usr/local/bin/python

##	Problem 1.
	##	Show that it is possible to buy exactly 50, 51, 52, 53, 54, and 55 McNuggets, by finding solutions to the Diophantine equation. You can solve this in your head, using paper and pencil ...
sebrenner
5 days ago

Homework: Lesson 2, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming

Straight forward assignment. The logarithm portion took me awhile to code. My math skills are rusty.

#!/usr/local/bin/python

##	Problem 1.  Write a program that computes and prints the 1000th prime number.
## This problem took just over one hour to program.

#	start with the first candiate
candidates = [1,3]

#	start with the know primes
primes ...
sebrenner
5 days ago

Homework: Lesson 1, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming

Pretty quick and easy assignment.

# Problem Set 0 
# Name: Scott Brenner
# Collaborators: None
# Date: 2011-01-04
# Start time: 7:05 PM
# End time: 7:18 PM
#

print ('Problem Set 0')
print ('Problem 1')

var_lname =  raw_input('What is your last name?')
#get user input and assign it ...
sebrenner
5 days ago

Homework: Lesson 1, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming

Problem Set 0

Name : Chris Tang

Collaborators: Nonyabusinaz

Time:1:32

firstname=raw_input ('What is your first name?: ') lastname=raw_input('What is your last name?: ') print 'Your name is:',firstname, lastname

#Problem Set 0
#Name : Chris Tang
#Collaborators: Nonyabusinaz
#Time:1:32
#
firstname=raw_input ('What is your first name?: ')
lastname=raw_input('What is your last name?: ')
print 'Your name is:',firstname, lastname
rcrrich
1 week ago

Homework: Lesson 1, HW 1

in Programming in C

include

int main(int argc, const char * argv[]) { printf("Hello, world!n"); return 0; }

#include <stdio.h>

int main(int argc, const char * argv[]) {
	printf("Hello, world!\n");
	printf("\c");
	return 0;
}

warning: unknown escape sequence '\c'
pygrokker
1 week ago

Homework: Lesson 1, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming

Problem Set 0

#Problem Set 0
#Name : Chris Tang
#Collaborators: Nonyabusinaz
#Time:1:32
#
firstname=raw_input ('What is your first name?: ')
lastname=raw_input('What is your last name?: ')
print 'Your name is:',firstname, lastname
ctang99
1 week ago

Topic: Zaczniesz obserwowa? na pozycjonowanie w charakterze na ?ród?o dochodu, wzmo?enie presti?u okolica, natomiast plus jej ogl?dalno?ci.

in the Programming Forum

Jaros?aw Kaczy?ski by? charyzmatycznym liderem, lecz w tej chwili obecnie nim nie jest. Nie pokazuje, o jak? Polsk? chce naparza? si?. On walczy tylko z Donaldem Tuskiem. Toczy prywatn? wojn?. Usz?o spo?ród niego owo powietrze lidera ...

yetroeprkl
2 weeks ago

Homework: Lesson 1, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming

problem set 0

caspar

lastname= raw_input ('what is your last name')
firstname= raw_input ('what is your first name')

print lastname,firstname
grwth
2 weeks ago

Homework: Lesson 1, HW 1

in Programming Ruby

Time.now

Time.now
menan89
2 weeks ago

Homework: Lesson 11, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming
# 6.00 Problem Set 6
#
# The 6.00 Word Game
#

import time
import random
import string

VOWELS = 'aeiou'
CONSONANTS = 'bcdfghjklmnpqrstvwxyz'
HAND_SIZE = 7

SCRABBLE_LETTER_VALUES = {
    'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i ...
ochikobore
3 weeks ago

Homework: Lesson 3, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming

Problem set 2

# Problem set 2.1a
# Shemmerson

# Show that it is possible to buy exactly 50, 51, 52, 53, 54, and 55 McNuggets, by finding
# solutions to the Diophantine equation.

a = 6
b = 9
c = 20

for n in range(50, 56 ...
Shemmerson
3 weeks ago

Homework: Lesson 2, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming

Ps1a

Ps1b

# Problem set 1a
# Name: Shemmerson
# Collaborators: CuriousReef
# Time: 2 Hrs


#finds 1000th prime

y = 1000
x=2
count=1
print "Finding 1000th prime"
while count<=y:
    prime=True
    for test in range (2, x):
            if x%test == 0:
                prime=False ...
Shemmerson
3 weeks ago

Homework: Lesson 1, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming

First assignment for MIT 6.00 OpenCourseWare

#Problem set 0
#Name: Shemmerson
#Time: 0.10

#ask for and print out a users last and first names

L = raw_input('Please enter your last name: ')
F = raw_input('Please enter your first name: ')
print F + ' ' + L

Shemmerson
3 weeks ago

Homework: Lesson 9, HW 2

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming
# Problem Set 5: Ghost
# Name: Andrew
# Collaborators: CuriousReef
# Time: 
#

import random

# -----------------------------------
# Helper code
# (you don't need to understand this helper code)
import string

WORDLIST_FILENAME = "words.txt"

def load_words():
    """
    Returns a list of valid words. Words are strings of lowercase ...
ochikobore
4 weeks ago

Homework: Lesson 9, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming
# Problem Set 5: 6.00 Word Game
# Name: 
# Collaborators: 
# Time: 
#

import random
import string

VOWELS = 'aeiou'
CONSONANTS = 'bcdfghjklmnpqrstvwxyz'
HAND_SIZE = 7

SCRABBLE_LETTER_VALUES = {
    'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j ...
ochikobore
4 weeks ago

Homework: Lesson 1, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming
fname = raw_input("Howdy, what's your first name?")
lname = raw_input("And your last?")
print fname, lname
andidious
4 weeks ago

Homework Comment: wolfei's Homework

I tried your code and it works, however most other Prime number testers have a line somewhere that goes something like this while (n <= (number**.5)): It is the half value being used in the test I am talking about ...

machv5
4 weeks ago

Homework: Lesson 2, HW 1

in MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming
#Problem Set 1
#Name: Andrew
#Collaborators: CuriousReef
#Time: 
from math import *

#problem 1
def isPrime(num):

    if num < 2:
        return False
    if num == 2:
        return True
    if num % 2 == 0:
        return False
    for i in range(3,int(ceil(sqrt ...
ochikobore
1 month ago