cs/stuff/GOOFY/height.py
lw-everestlinux 19881139f2 HI
2022-10-17 11:20:54 -04:00

40 lines
889 B
Python
Executable File

#!/usr/bin/env pypy
# Get user input
ft1 = int(input("Feet: "))
in1 = int(input("Inches: "))
ft2 = int(input("Feet: "))
in2 = int(input("Inches: "))
ft3 = int(input("Feet: "))
in3 = int(input("Inches: "))
# Find totals
totalFeet = ft1 + ft2 + ft3
totalInches = in1 + in2 + in3
# Print totals
print("Total feet: " + str(totalFeet))
print("Total inches: " + str(totalInches))
# Convert to meters
totalMeters = float(totalFeet // 3.2)
totalCm = float(totalInches * 2.54)
print("=============================")
# Print conversions
print("Total meters: " + str(totalMeters))
print("Total centimeters: " + str(totalCm))
print("==============================")
# Find average
heightsFt = ft1 + ft2 + ft3
averageFt = heightsFt // 3
heightsIn = in1 + in2 + in3
averageIn = heightsIn // 3
# Output average
print("Average feet: " + str(averageFt))
print("Average inches: " + str(averageIn))