Advertisement
Guest User

Untitled

a guest
Jul 7th, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. def main():
  2. print("hello, world!")
  3. x = eval(input("give me a number! "))
  4. print(x+1,"is my favorite number!!")
  5. main()
  6.  
  7. Python tells me:
  8. Desktop$ python hello.py
  9. hello, world!
  10. type a word: hi
  11. Traceback (most recent call last):
  12. File "hello.py", line 7, in <module>
  13. main()
  14. File "hello.py", line 3, in main
  15. x = (input("type a word: "))
  16. File "<string>", line 1, in <module>
  17. NameError: name 'hi' is not defined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement