Hello again.
Im making a text-based dungeon-adventure game. And I came across a strange "error" in my code.
">" Means "The stuff on this side is bigger > The stuff on this side is smaller"
Right? Well when this part of my code is run, if the age the user inputs is over 21, it says "You're kinda young.. blah blah"
But if the number they input is UNDER 21, it says "You're old enough to drink!... blah blah"
So it seems like the greater than and less than are mixed up. Or is there something I don't understand?
Im making a text-based dungeon-adventure game. And I came across a strange "error" in my code.
">" Means "The stuff on this side is bigger > The stuff on this side is smaller"
Right? Well when this part of my code is run, if the age the user inputs is over 21, it says "You're kinda young.. blah blah"
But if the number they input is UNDER 21, it says "You're old enough to drink!... blah blah"
So it seems like the greater than and less than are mixed up. Or is there something I don't understand?
Code:
age = raw_input("How old are you? ") if age < 21: print("You're kinda young to be playing this game... Oh well.") if age >= 21: print("You're old enough to drink! I think you can play a text-based game. He he.")
Comment