Advertisement
here2share

# str_check.py

Sep 5th, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. # str_check.py
  2.  
  3. def check(s):
  4.     print s,'is',isinstance(s, str)
  5.  
  6. check(['abc'])
  7. check(('abc'))
  8. check(('abc',)) # comma added to remain as tuple
  9. check({'abc'})
  10. check('abc')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement