Python 3.2 Question
Brett Michaels <[email protected]> Sat, 12 Jan 2013 09:32:35 -0500
| Newsgroups | gmane.org.user-groups.jaxlug |
|---|---|
| Message-ID | <CAN1q9fD1PZV_2_1VvZ4wfgJOod4Y9y4YUSN6K_zXszcO9N+ZBQ@mail.gmail.com> |
--089e0103ee908020d004d3184875
Content-Type: text/plain; charset=ISO-8859-1
Below is what the instructor says we are supposed to be able to do:
year = eval(input("Enter year: "))
if year == 1:
print ("Freshman")
if year == 2:
print ("Sophomore")
if year == 3:
print ("Junior")
if year == 4:
print ("Senior")
But all Python ever does is execute the first line and ignore everything else.
Below is my result working in "Idle", but the result is the same
working from Xterm:
>>> year = eval(input("Enter year: "))
if year == 1:
print ("Freshman")
if year == 2:
print ("Sophomore")
if year == 3:
print ("Junior")
if year == 4:
print ("Senior")
Enter year: 3
>>> year=eval(input("Enter year:"))
Enter year:
This only seems to happen with the "eval(input..." sequence?(Not sure
what the correct term is)
How to get the entire program to execute?
Hugh
--089e0103ee908020d004d3184875--