[Tutor] Python skipping if statement (Really simple code)
Alan Gauld
alan.gauld at btinternet.com
Fri Apr 15 09:50:04 CEST 2011
"Casey Key" <i.eat.brainzzz at gmail.com> wrote
> Hey im a newbie to python, but i made this test code. and it is just
> skipping over the if statement, which is essential to the program.
Which if statement, there are several?
Are there any error messages? If so send them in their entirety.
If not can you show us whatever output you do get.
If you know which if statement is failing have you tried inserting
a print statement to show what the test value is actually stored
as? (For example the first if statement would require:
print (caution)
just before the if statement.
)
HTH,
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
>
> import random
>
> print("Renees a hater, and you know what happens to hater? They
> hate!")
> print("They purpose of this program is to express your feelings
> toward
> Renee.")
> print("Note:I am not pointing of a particular Renee it is just a
> random
> name.")
>
> caution = input("After reading the note do you want to proceed? ")
> if caution == "yes" :
> print("Lets get started.")
> hate = random.randint(1, 5)
> print("Renees hate level is at ", hate)
> proceed = input(int("Do you want to see Renees hate in form of a
> picture? "))
> if proceed == "yes":
> print("Chose a number between 1 and 3. ")
> choice = input("So whats your choice? ")
> if choice == "1":
> print(
> """
> ,
> (`. : \ __..----..__
> `.`.| |: _,-':::''' ' `:`-._
> `.:\|| _,':::::' `::::`-.
> \\`| _,':::::::' `:. `':::`.
> ;` `-'' `::::::. `::\
> ,-' .::' `:::::. `::.. `:\
> ,' /_) -. `::. `:. |
> ,'.: ` `:. `:. .::. \
> __,-' ___,..-''-. `:. `. /::::. |
> |):'_,--' `. `::.. |::::::. ::\
> `-' |`--.:_::::|_____\::::::::.__ ::|
> | _/|::::| \::::::|::/\ :|
> /:./ |:::/ \__:::):/ \ :\
> ,'::' /:::| ,'::::/_/ `. ``-.__
> jrei '''' (//|/\ ,';':,-' `-.__
> `'--..__
>
> """)
> elif choice == "2":
> print(
> """
>
> _,\,\,\|\|\|\|\|\|\|\/-\___.._
> __,-' () .\
> / __/---\___ __ ---/
> | / \ \___________/\\ \___/
> | | \ \ \\
> | | / | \\__/_
> | | | \/_ /\
> || \--\
> ||
> \\_______
> \-------\\____
>
> """)
> elif choice == "3":
> print(
> """
> /\
> ( ;`~v/~~~ ;._
> ,/'"/^) ' < o\ '".~'\\\--,
> ,/",/W u '`. ~ >,._.., )'
> ,/' w ,U^v ;//^)/')/^\;~)'
> ,/"'/ W` ^v W |; )/'
> ;'' | v' v`" W } \\
> " .'\ v `v/^W,) '\)\.)\/)
> `\ ,/,)' ''')/^"-;'
> \ ?
> ".
> \
> """)
> suprise = input("Are you ready for a suprise?")
> if suprise == "yes":
> print(
> """
>
> MMM88&&&,
> ,MMM8&&&. `'MMM88&&&,
> MMMMM88&&&& 'MMM88&&&,
> MMMMM88&&&&&& 'MMM88&&&,
> MMMMM88&&&&&& 'MMM88&&&
> MMMMM88&&&&&& 'MMM88&&&
> MMMMM88&&&& MMM88&&&
> 'MMM8&&&' MMMM888&&&& 'MM88&&&
> MMMM88&&&&& MM88&&&
> MMMM88&&&&& MM88&&&
> ,MMM8&&&. MM88&&&
> MMMMM88&&&& ,MM88&&&
> MMMMM88&&&&&& MMM88&&&'
> MMMMM88&&&&&& MMM88&&&'
> MMMMM88&&&&&& MMM88&&&'
> MMMMM88&&&& MMM88&&&'
> 'MMM8&&&' MMM88&&&'
> MMM88&&&'
>
> .
> """)
> input("\n\nPress the enter key to exit.")
>
--------------------------------------------------------------------------------
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
More information about the Tutor
mailing list