Last active
December 20, 2015 22:09
-
-
Save stevencombs/6202799 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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