Advertisement
here2share

# b_list_all_variables.py

Nov 7th, 2019
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. # b_list_all_variables.py
  2.                                                          
  3. foo1 = "Hello World!"
  4. foo2 = ["foo","bar",123]
  5. foo3 = {1:"a",2:"b","xyz":"c"}
  6. foo4 = "1+1"
  7. foo5 = 0.12
  8.  
  9. for name in dir():
  10.     if not name.startswith('_'):
  11.         myvalue = eval(name)
  12.         print "Variable", name, "is", type(myvalue), "...\n\t with value of ", myvalue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement