• Create a function to match the specifications • Use floating-point value division • Write a program to get the user input and call the custom function and produce the desired output using a format...


I am lost on how to use the "if_name_=='_main_':" to solve this problem.


• Create a function to match the specifications<br>• Use floating-point value division<br>• Write a program to get the user input and call the custom function and produce the desired output using a<br>format function to output the specified precision<br>Instructions<br>A pedometer treats walking 2,000 steps as walking 1 mile. It assumes that one step is a bit over 18 inches (1<br>mile = 36630 inches, so the pedometers assume that one step should be 18.315 inches).<br>Let's customize this calculation to account for the size of our stride. Write a program whose input is the number<br>of steps and the length of the step in inches, and whose output is the miles walked.<br>Output each floating-point value with two digits after the decimal point, which can be achieved as follows:<br>print ('{:.2f}'.format(your_value))<br>Ex: If the input is:<br>5345<br>18.315<br>the output is:<br>You walked 5345 steps which is about 2.67 miles.<br>Your program must define and call the following function. The function should return the amount of miles<br>walked.<br>def steps_to_miles(user_steps, step_length)<br>main.py<br>Load default template..<br>1 # Define your function here<br>2 def steps_to_miles(user_steps, step_length):<br>step_length = 18.315<br>one_mile = user steps / 2000<br>one_mile = (one_mile * step_length)/step_length<br>return one_mile<br>3<br>4<br>6<br>7<br>8<br>10 if<br>== ' main ':<br>_name<br># Type your code here.<br>11<br>

Extracted text: • Create a function to match the specifications • Use floating-point value division • Write a program to get the user input and call the custom function and produce the desired output using a format function to output the specified precision Instructions A pedometer treats walking 2,000 steps as walking 1 mile. It assumes that one step is a bit over 18 inches (1 mile = 36630 inches, so the pedometers assume that one step should be 18.315 inches). Let's customize this calculation to account for the size of our stride. Write a program whose input is the number of steps and the length of the step in inches, and whose output is the miles walked. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print ('{:.2f}'.format(your_value)) Ex: If the input is: 5345 18.315 the output is: You walked 5345 steps which is about 2.67 miles. Your program must define and call the following function. The function should return the amount of miles walked. def steps_to_miles(user_steps, step_length) main.py Load default template.. 1 # Define your function here 2 def steps_to_miles(user_steps, step_length): step_length = 18.315 one_mile = user steps / 2000 one_mile = (one_mile * step_length)/step_length return one_mile 3 4 6 7 8 10 if == ' main ': _name # Type your code here. 11

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here