Created
June 5, 2020 16:41
-
-
Save edwindotcom/16575396e940918ee666b77dca29d4fd to your computer and use it in GitHub Desktop.
convert inches to foot-inches
This file contains hidden or 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
import sys | |
import math | |
def inch_to_ft_inch(inches): | |
ft = math.floor(int(inches)/12) | |
ret_inch = int(inches) % 12 | |
return ft, ret_inch | |
val = inch_to_ft_inch(sys.argv[1]) | |
print("{}\' {}\"".format(int(val[0]), val[1])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment