469,277 Members | 2,372 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,277 developers. It's quick & easy.

Ways to "reset" raw_input

Is there any way of "reseting" the raw_input so it is able to =a rather than =x and is there anything else that is wrong with it ?:P Im using python 2.7.2

Expand|Select|Wrap|Line Numbers
  1. x = raw_input ("enter name here: ")
  2. print "hello " +x
  3. print "how are you? Good or bad?"
  4.  
  5. a=raw_input 
  6.  
  7. if a == "good":
  8.     print "awesome!"
  9. elif a== "bad":
  10.     print "oh no"
  11.  
  12.  
  13. print " why you " + a +"?"
  14.  
  15. raw_input("press <enter>")
Jun 27 '11 #1

✓ answered by bvdet

Line number 5 needs parentheses after raw_input for the function call.

1 1985
bvdet
2,851 Expert Mod 2GB
Line number 5 needs parentheses after raw_input for the function call.
Jun 27 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Draken | last post: by
22 posts views Thread by Peter Ammon | last post: by
4 posts views Thread by Amir | last post: by
2 posts views Thread by big vinny | last post: by
9 posts views Thread by storyGerald | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.