Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hi = ['hi', 'hello']
- x = 0
- def hi():
- print hi[x]
- for l in range(2):
- hi()
- x = 1
- ---------------------------
- >>> ================================ RESTART ================================
- >>>
- Traceback (most recent call last):
- File "C:/Python26/text3.py", line 7, in <module>
- hi()
- File "C:/Python26/text3.py", line 4, in hi
- print hi[x]
- TypeError: 'function' object is unsubscriptable
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement