Re: [Tutor] Output never stops

2008-08-04 Thread bob gailer
David wrote: [snip] #!/usr/bin/python person = {'Lary':43,'Joan':24} choice = 0 while choice != '-1': if choice == '': print "You must enter Lary or Joan to continue! (-1 to quit): " choice = raw_input( "Who's age do want to know, Lary or Joan? (-1 to quit): ") if ch

Re: [Tutor] Output never stops

2008-08-03 Thread Alan Gauld
"David" <[EMAIL PROTECTED]> wrote Thanks Alan, also your tutorial/book is a big help. I think I got it :) Close but not quite there yet. choice = 0 while choice != '-1': if choice == '': print "You must enter Lary or Joan to continue! (-1 to quit): " choice = raw_input(

Re: [Tutor] Output never stops

2008-08-03 Thread David
Alan Gauld wrote: "David" <[EMAIL PROTECTED]> wrote the output never stops when I run this in a terminal choice = raw_input("Enter the name Lary or Joan (-1 to quit): ") while choice != '-1': person = {'Lary': 43,'Joan': 24} if choice == 'Lary': print "Lary's age is:", perso

Re: [Tutor] Output never stops

2008-08-03 Thread Alan Gauld
"David" <[EMAIL PROTECTED]> wrote the output never stops when I run this in a terminal choice = raw_input("Enter the name Lary or Joan (-1 to quit): ") while choice != '-1': person = {'Lary': 43,'Joan': 24} if choice == 'Lary': print "Lary's age is:", person.get('Lary')

Re: [Tutor] Output never stops

2008-08-02 Thread Vivek Sant
Hi David, Simple explanation - you should use if instead of while. A while statement executes whatever is in that block again and again until the condition becomes false. So your code, the way you have it, first checks if the user's input is not -1. If you have typed Lary, it goes on to p

Re: [Tutor] Output never stops

2008-08-02 Thread David
David wrote: Very new to python and never programed before. Can not figure out why the output never stops when I run this in a terminal #!/usr/bin/python choice = raw_input("Enter the name Lary or Joan (-1 to quit): ") while choice != '-1': person = {'Lary': 43,'Joan': 24} if choi

[Tutor] Output never stops

2008-08-02 Thread David
Very new to python and never programed before. Can not figure out why the output never stops when I run this in a terminal #!/usr/bin/python choice = raw_input("Enter the name Lary or Joan (-1 to quit): ") while choice != '-1': person = {'Lary': 43,'Joan': 24} if choice == 'Lary':