Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

Hi theret Is there any body who can tell me what is the problem in this small python code? or How it should looks like? def eval_loop(): while True: n = raw_input('Enter whatever:\n') if n == 0: break else: return eval('n')

OpenStudy (anonymous):

The return statement at the end should be indented as the 'break' statement

OpenStudy (rsmith6559):

In the return statement, you're evaluating the letter n, not the variable n. Watch the quotes.

OpenStudy (anonymous):

No no no... quotes are fine... that's the syntax of the eval!

OpenStudy (anonymous):

did u forget one of these ; ; ; ; ; ; ; ;

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
2 days ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
2 days ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!