logo codesdope

>>> print "Enter your name" x = raw_input() y = raw_input("age >>>") #age>>> will be printed before input print "Your name is",x,"and","and your ag

   Shivam Gupta

>>> print "Enter your name" x = raw_input() y = raw_input("age >>>") #age>>> will be printed before input print "Your name is",x,"and","and your age is",y, Enter your name >>> xyz Traceback (most recent call last): File "", line 1, in xyz NameError: name 'xyz' is not defined


Answers

  •    Amit Kumar , I.I.T. Patna

    See http://ideone.com/MzyNwD for the running example.


    • but why error is showing in python sell?
      - Shivam Gupta
    • if i'm running this code directly from shell,then i'm getting error if i'm running this code from new file,then i'm getting no error any reason for the same?
      - Shivam Gupta
    • It's not possible to figure out the exact mistake but I guess you are giving xyz just after "Enter your name is printed". Enter x = raw_input() to take the input of the name and then enter xyz.
      - Amit Kumar
    • okay..thanks for the help :)
      - Shivam Gupta
    • by the way you run code directly from shell or you use new file?
      - Shivam Gupta
    • okay..thanks
      - Shivam Gupta
    • It depends. When have to do small stuffs, I use shell but for long codes or the codes which I have to use again, I use file.
      - Amit Kumar

Share what you know
Write your answer
Close

Welcome.please sign up.

Close

Welcome.please login.