Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDinko Galetic <dgaletic@everflame.(none)>2010-06-27 11:30:27 (GMT)
committer Dinko Galetic <dgaletic@everflame.(none)>2010-06-27 11:30:27 (GMT)
commitcbb9edd9f500987206b6990b49a7d152afd3cdf4 (patch)
tree1908a8f5a5139225e988b10fce7110bbb689f7f6
parentd33d9ae50870162cab80b08e82169e89018a9d1b (diff)
User replies are now switched to lowercase before checking them.
Slight modification to the definition of programming.
-rw-r--r--library/introduction.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/library/introduction.py b/library/introduction.py
index 5441fad..17f4ffe 100644
--- a/library/introduction.py
+++ b/library/introduction.py
@@ -3,15 +3,14 @@ def run():
print """Hello there, and welcome to PyTutor.
Before we continue, please tell me your name. You can type it in right here:"""
answer = "no"
- while answer == "no" or answer == "No":
+ while answer == "no".lowercase():
name = raw_input(">>> ")
print "Your name is " + name + ". Did I get it right? You can answer \"yes\" or \"no\"."
answer = raw_input(">>> ")
- # Support other answers?
- while answer != "yes" and answer != "no" and answer != "Yes" and answer != "No":
+ while answer.lowercase() != "yes" and answer.lowercase() != "no":
print "Please answer \"yes\" or \"no\"."
answer = raw_input(">>> ")
- if answer == "no" or answer == "No":
+ if answer.lowercase() == "no":
print "Please enter your name again: "
# TODO: Reading the whole text without guidance.
print "Hello again, " + name + """. Before you is a set of lessons about computer programming, or just "programming" for short. I will present them to you and guide you through them. You can also read them yourself without my guidance.
@@ -19,7 +18,7 @@ If at any time you wish to quit, just type in \"quit\". You can always resume th
To continue, just press enter."""
if raw_input(">>> ") == "quit":
quit()
- print """So, the beginning. What is computer programming? In most cases, it is writing your computer what you want it to do, and that is what we will be doing.
+ print """So, the beginning. What is computer programming? In most cases, it is writing down a sequence of tasks that you want your computer to do, and that is what we will be doing.
Fox example, you could tell your computer to make some calculations for you. Whenever you see ">>> " on the screen, that means that you can type. *(TODO: explain this differently)?*
Try typing "print 10 + 3". """
exactly = True