This commit is contained in:
lw-everestlinux 2022-10-17 11:20:54 -04:00
parent bc6333790c
commit 19881139f2

39
stuff/GOOFY/height.py Executable file
View File

@ -0,0 +1,39 @@
#!/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))