15,669,040 members
1.00/5 (1 vote)
See more:
Hi I have to do this for my assignment but I need help!. I have tried entering the letter I but it doesn't work please tell me what am doing wrong or didn't do cant seem to figure it out.
This program will convert distances (Inches/Miles)
Ehter (I) to convert Inches to miles
Enter (M) to convert Miles to Inches
Enter selection: I
Enter distance to convert: 115
115.0 Inches equals 0.00181502 Miles. then

This program will convert distances (inches/miles)
enter (I) to convert to Miles
enter (M) to convert miles to inches
enter selection: N
Please enter 'I' or 'M': R

What I have tried:

this is all I have done
tterinteger = I
d_ft = int(input("Enter (I) to convert Inches to Miles: "))

d_miles = d_ft / 5280.0
d_yards = d_ft / 3.0

print("The distance in inches is %i inches." % d_inches)
print("The distance in yards is %.2f yards." % d_yards)
print("The distance in miles is %.2f miles." % d_miles)
12345678
Posted
Updated 31-Oct-18 10:50am

## Solution 1

You are asking for an input in inches, and treating it as if it was in feet...
Try this:
Python
```d_inches = int(input("Enter Inches to convert: "))
d_ft = d_inches / 12.0
d_miles = d_ft / 5280.0
d_yards = d_ft / 3.0

print("The distance in inches is %i inches." % d_inches)
print("The distance in feet is %.1f feet." % d_ft)
print("The distance in yards is %.2f yards." % d_yards)
print("The distance in miles is %.6f miles." % d_miles)```

## Solution 2

Here is the multiplication table set for conversions. Repeating decimals are signified by a - at the end of the decimal
```inch	feet	  yard    mile
_____  ________   _______  ___________
1	    0.0833-	  0.0277-  0.000015782
12	    1	      0.33-	   0.000189394
36	    3	      1	       0.0005681-
63360	5280	  1760	   1```