
January 2nd, 2013, 01:15 AM
|
|
Contributing User
|
|
Join Date: Dec 2012
Posts: 75
  
Time spent in forums: 1 Day 2 h 56 m 44 sec
Reputation Power: 2
|
|
The behaviour of the input function was changed from Python 2 to Python 3. In Python 2, it would evaluate the input given to it; while in Python 3 it simply returns it as a string. If you want an int, you'll have to call int() (or eval(), but don't do that) on it, like so:
Code:
age = int(input("Please enter your age: "))
if age > 60:
print("Wow, you are quite old.")
else:
print("You are not that old.")
In addition, please put your code in code tags in the future. Code tags will preserve indentation which is very important in Python.
|