Skip to content

Instantly share code, notes, and snippets.

@stevencombs
Last active December 20, 2015 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevencombs/6202799 to your computer and use it in GitHub Desktop.
Save stevencombs/6202799 to your computer and use it in GitHub Desktop.
# Number is Integer or Float - return Absolute Function
# A Codecademy Python (Review: Built-In Functions) assignment
# Dr. Steven B. Combs, coding novice
def distance_from_zero(a):
"""Integer or Float to Absolute"""
if type(a) == int or type(a) == float:
return abs(a)
else:
return "Not an integer or float!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment