Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_the_int(singleton_or_int):
- with suppress(TypeError):
- return singleton_or_int[0]
- return singleton_or_int
- for e in [5, (7,)]:
- print('I got the integer: ', get_the_int(e))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement