#Decompose into feet and inches for the first line
feet, inches = divmod(totalInches, INCHES_PER_FOOT)

#Totals in other units (as decimals)
totalFeet = totalInches / INCHES_PER_FOOT
totalYards = totalInches / INCHES_PER_YARD
totalMiles = totalInches / INCHES_PER_MILE

#Optional: also show miles -> yards -> feet -> inches breakdow
miles, rem_after_miles = divmod(totalInches, INCHES_PER_MILE)
yards, rem_after_yards = divmod(rem_after_miles, INCHES_PER_YARD)
feet_m, inches_m = divmod(rem_after_yards, INCHES_PER_FOOT)

#Outputs
print(f"{feet}' {inches}\"")
print(f"Total inches: {totalInches}")
print(f"Total feet: {totalFeet}")
print(f"Total yards: {totalYards}")
print(f"Total miles: {totalMiles}")
print(f"Miles: {miles}, Yards: {yards}, Feet: {feet_m}, Inches: {inches_m}")

# Hierarchical breakdown
print(f"Miles: {miles}, Yards: {yards}, Feet: {feet_m}, Inches: {inches_m}")

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: