Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- print("hello, world!")
- x = eval(input("give me a number! "))
- print(x+1,"is my favorite number!!")
- main()
- Python tells me:
- Desktop$ python hello.py
- hello, world!
- type a word: hi
- Traceback (most recent call last):
- File "hello.py", line 7, in <module>
- main()
- File "hello.py", line 3, in main
- x = (input("type a word: "))
- File "<string>", line 1, in <module>
- NameError: name 'hi' is not defined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement