Skip to content

Instantly share code, notes, and snippets.

@tswann
Created October 19, 2017 14:12
Show Gist options
  • Save tswann/e8476f88b5b477a3b8a55aeab8780d68 to your computer and use it in GitHub Desktop.
Save tswann/e8476f88b5b477a3b8a55aeab8780d68 to your computer and use it in GitHub Desktop.
def myfunction(arg):
if isinstance(arg, str):
print(‘Do something stringy: {}’.format(arg))
elif isinstance(arg, int):
print(‘Do something octal: {0:o}’.format(arg))
elif isinstance(arg, float):
print(‘Do something floaty: {0:.2f}’.format(arg))
else:
print(‘Do something generic: {}’.format(arg))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment