Commits

Ramakrishna Reddy Yekulla committed 178f5fc

Added workouts ex30.py and ex31.py

Comments (0)

Files changed (4)

+people = 30
+cars = 40
+buses = 15
+
+if cars > people:
+    print "We should take the cars"
+elif cars < people:
+    print "We should not take the cars."
+else:
+    print "We can't decide."
+
+if buses > cars:
+    print "That's too many buses."
+elif buses < cars:
+    print "Maybe we could take the buses."
+else:
+    print "We still can't decide."
+
+if people > buses:
+    print "Alright, let's just take the buses."
+else:
+    print "Fine, let's stay home then."

lpthw/ex30.py~

Empty file added.
+print "You enter a dark room with two doors. Do you go throught door # 1 or door #2?"
+
+door = raw_input("> " )
+
+if door == "1":
+    print "There's a gaint bear here eating a cheese cake. what dod you do?"
+    print "1. Take the cake."
+    print "2. Scream at the bear"
+
+    bear = raw_input("> ")
+    
+    if bear == "1":
+        print "The bear eats your face off.  Good job!"
+    elif bear == "2":
+        print "The bear eats your leg off. Good Job!"
+    else:
+        print "Well, doing %s is probably better. Bear runs away." % bear
+
+elif door == "2":
+    print "You stare into the endless abyss at Cthulhu's retina."
+    print "1. Blueberries"
+    print "2. Yellow Jacket clothespins."
+    print "3. Understanding revolvers yelling melodies."
+
+    insanity = raw_input("> ")
+
+    if insanity == "1" or insanity == "2":
+        print "Your bosy survives powered by a mind of jello. Good job!"
+    else:
+        print "The insanity rots your eyes into a pool of muck. Good Job!"
+
+else:
+    print "You stumble around and fall on a knife and die. Good job!"
+

lpthw/ex31.py~

Empty file added.