203k views
24 votes
A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number of steps, and whose output is the miles walked.

User Outkkast
by
3.2k points

1 Answer

5 votes

Answer:

The program in Python is as follows:

steps = int(input("Steps: "))

miles= steps/2000

print("Miles: "+str(miles))

Step-by-step explanation:

This prompts the user for number of steps

steps = int(input("Steps: "))

This calculates the miles walked

miles= steps/2000

This prints the calculated miles

print("Miles: "+str(miles))

User Neonidian
by
3.7k points