Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # b_list_all_variables.py
- foo1 = "Hello World!"
- foo2 = ["foo","bar",123]
- foo3 = {1:"a",2:"b","xyz":"c"}
- foo4 = "1+1"
- foo5 = 0.12
- for name in dir():
- if not name.startswith('_'):
- myvalue = eval(name)
- print "Variable", name, "is", type(myvalue), "...\n\t with value of ", myvalue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement