def height(cent):
height= {}
height["feet"]= int(cent/30.48)
height["inch"]= int(cent%30.48)/2.54
print (height)
height (182.88)
print (182.88/30.48)
print (182.88%30.48)
The output is: {'inch': 11, 'feet': 6}
6.0
30.479999999999993
Why does 182.88%30.48 not equal zero?
182.88 / 30.48is 6.033, not 6 exactly.h = int(cent / 2.54), then use integer arithmetic to computefeet, inches = divmod(h, 12).