Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-22 Thread Santosh Kumar
In first half of this script: prompt = raw_input(Can you tell me your name? ) if prompt in (Yes, yes, y, Y): name = raw_input(What's your name? ) elif prompt in (No, no, n, N): exit(OK, have nice day..) else: prompt = name if name == Santosh: print Hey! I have the same name. elif

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-22 Thread Alan Gauld
On 22/07/12 06:58, Santosh Kumar wrote: prompt = raw_input(Can you tell me your name? ) if prompt in (Yes, yes, y, Y): name = raw_input(What's your name? ) elif prompt in (No, no, n, N): exit(OK, have nice day..) else: prompt = name Don't you want name = prompt? I

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-18 Thread Steven D'Aprano
Alexandre Zani wrote: What you want to write is this: elif name == John Cleese or name == Michael Palin: elif name in (John Cleese, Michael Palin): is better. -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-18 Thread Alexandre Zani
On Wed, Jul 18, 2012 at 6:09 AM, Steven D'Aprano st...@pearwood.info wrote: Alexandre Zani wrote: What you want to write is this: elif name == John Cleese or name == Michael Palin: elif name in (John Cleese, Michael Palin): is better. -- Steven

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-18 Thread Steven D'Aprano
Alexandre Zani wrote: On Wed, Jul 18, 2012 at 6:09 AM, Steven D'Aprano st...@pearwood.info wrote: Alexandre Zani wrote: What you want to write is this: elif name == John Cleese or name == Michael Palin: elif name in (John Cleese, Michael Palin): is better. Better how? It's shorter,

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-18 Thread Alexandre Zani
On Wed, Jul 18, 2012 at 7:44 AM, Steven D'Aprano st...@pearwood.info wrote: Alexandre Zani wrote: On Wed, Jul 18, 2012 at 6:09 AM, Steven D'Aprano st...@pearwood.info wrote: Alexandre Zani wrote: What you want to write is this: elif name == John Cleese or name == Michael Palin: elif

[Tutor] Why isn't my simple if elif script not working?

2012-07-17 Thread Santosh Kumar
Here is my script: name = raw_input(What's your name? ) if name == Santosh: print Hey!! I have the same name. elif name == John Cleese or Michael Palin: print I have no preference about your name. Really!! else: print You have a nice name. The if part works well. The elif part

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-17 Thread Andre' Walker-Loud
Hi Santosh, On Jul 17, 2012, at 10:09 PM, Santosh Kumar wrote: Here is my script: name = raw_input(What's your name? ) if name == Santosh: print Hey!! I have the same name. elif name == John Cleese or Michael Palin: print I have no preference about your name. Really!! else:

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-17 Thread Alexandre Zani
On Tue, Jul 17, 2012 at 10:09 PM, Santosh Kumar sntshkm...@gmail.com wrote: Here is my script: name = raw_input(What's your name? ) if name == Santosh: print Hey!! I have the same name. elif name == John Cleese or Michael Palin: print I have no preference about your name. Really!!

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-17 Thread Alexandre Zani
On Tue, Jul 17, 2012 at 10:21 PM, Andre' Walker-Loud walksl...@gmail.com wrote: Hi Santosh, On Jul 17, 2012, at 10:09 PM, Santosh Kumar wrote: Here is my script: name = raw_input(What's your name? ) if name == Santosh: print Hey!! I have the same name. elif name == John Cleese or

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-17 Thread Andre' Walker-Loud
On Jul 17, 2012, at 10:29 PM, Alexandre Zani wrote: On Tue, Jul 17, 2012 at 10:21 PM, Andre' Walker-Loud walksl...@gmail.com wrote: Hi Santosh, On Jul 17, 2012, at 10:09 PM, Santosh Kumar wrote: Here is my script: name = raw_input(What's your name? ) if name == Santosh:

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-17 Thread Ross Wilson
On 18/07/12 15:09, Santosh Kumar wrote: Here is my script: name = raw_input(What's your name? ) if name == Santosh: print Hey!! I have the same name. elif name == John Cleese or Michael Palin: print I have no preference about your name. Really!! else: print You have a nice