Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- feet = input("Enter the height in feet: ") # firstly taking the input in feet
- if feet == "": # then checking if it's blank, then, will exit the code.
- exit()
- feet = int(feet)
- inch = input("Enter the height in inch: ") # Same thing for inch
- if inch == "":
- exit()
- inch = int(inch)
- total = (feet*12) + inch # changing the feet into inch and hence getting the total height in inch.
- if total >= 96: # in this line I am checking if the height is more than 96, and hence saying that the person is tall
- print("The person is really tall!")
- total_cm = total*2.54 # converting the total height in inch to centimeter
- m_and_cm = round(total_cm/100,2) # then converting in meter and rounding up to two decimal place
- print(f'{feet} feets {inch} inches are equivalent to {m_and_cm} meters') # finally printing the solution.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement