Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # var_type.py
- s = "abc"
- print type(s) is str
- s = 123
- print type(s) is int
- s = 0.5
- print type(s) is int # False
- s = 0.5
- print type(s) is float
- s = {}
- print type(s) is dict
- s = []
- print type(s) is list
- s = ()
- print type(s) is tuple
- s = None
- print type(s) is None # ???
- print type(s) == None # ???
- print type(s) is "<type 'NoneType'>" # ???
- print type(s) == "<type 'NoneType'>" # ???
- var = str(type(s))
- print var == "<type 'NoneType'>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement