[Tutor] if statement

Robert Berman bermanrl at cfl.rr.com
Tue Nov 2 21:00:35 CET 2010



> -----Original Message-----
> From: tutor-bounces+bermanrl=cfl.rr.com at python.org [mailto:tutor-
> bounces+bermanrl=cfl.rr.com at python.org] On Behalf Of Glen Clark
> Sent: Tuesday, November 02, 2010 3:07 PM
> To: python mail list
> Subject: Re: [Tutor] if statement
> 
> sorry:
> 
> 
> confirmed = int(input("Are you happy with this? (y/n): ")
> 
> if confirmed == "y":
>    for In in range(0,NumItems):
>       print(Entries[In] + ": " + str(In))
>    change = int(input("Which item would you like to change: ")
>    Entries[change]=str(input("Please enter a nem name: ")
> else:
>     #do nothing

Whoops. Why are you trying to make the variable "confirmed" an integer rather
than a simple 'y/n' as you are asking for?

Robert Berman





--
I am using the free version of SPAMfighter.
We are a community of 7 million users fighting spam.
SPAMfighter has removed 34 of my spam emails to date.
Get the free SPAMfighter here: http://www.spamfighter.com/len

The Professional version does not have this message




More information about the Tutor mailing list