Advertisement
Guest User

Untitled

a guest
May 2nd, 2014
585
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. def get_the_int(singleton_or_int):
  2.     with suppress(TypeError):
  3.         return singleton_or_int[0]
  4.     return singleton_or_int
  5.  
  6. for e in [5, (7,)]:
  7.     print('I got the integer: ', get_the_int(e))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement