elz: (ada-tubes)
[personal profile] elz posting in [community profile] intro_to_cs
First:

Open to: Registered Users, detailed results viewable to: All, participants: 25


Tickyboxes!

View Answers

Finished lecture 2
24 (96.0%)

Finished problem set 1
15 (60.0%)



Also, it occurs to me that it might be handy to have a place to post/discuss solutions to the problem sets, to see what we can learn from each other in the absence of TAs. If you actually go to MIT and the problem sets are still the same, don't read these. ;)

Fire away!

Date: 2009-11-16 04:26 am (UTC)
zulu: Omar Epps, looking awesome (house - epps)
From: [personal profile] zulu
On the other hand, check this out:

#odds

# This script will calculate the nth odd number

odd = 0
counter = 0
odds = []

print ("Let's find the nth odd number. Please enter a postive integer: ")
answer = raw_input()
nth = int(answer)

while counter < nth:
     if odd % 2 == 0:
          print str(odd) + (" is even. It doesn't go on the list.")
          odd = odd + 1
          print ("We have found ") + str(counter) +(" odd numbers. Let's keep going.")

     elif odd % 2 != 0:
          print str(odd) + " is odd. It goes on the list."
          odds.append(odd)
          if len(odds) == int(nth):
               print ("The ") + str(nth) + ("th odd number is ") + str(odd)
               break
          else:
               print ("We have found ") + str(len(odds)) +(" odd numbers. Let's keep going.")
               odd = odd + 1
               counter = counter + 1
Edited Date: 2009-11-16 04:28 am (UTC)

Profile

Introduction to Computer Science

July 2010

S M T W T F S
    123
45678910
11121314151617
18192021222324
2526272829 3031

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 15th, 2025 11:25 am
Powered by Dreamwidth Studios