- 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
SHARE
TWEET
Untitled
a guest
Jul 7th, 2012
21
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data

