From cbb9edd9f500987206b6990b49a7d152afd3cdf4 Mon Sep 17 00:00:00 2001 From: Dinko Galetic Date: Sun, 27 Jun 2010 11:30:27 +0000 Subject: User replies are now switched to lowercase before checking them. Slight modification to the definition of programming. --- 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 -- cgit v0.9.1