A pedometer treats walking 1 step as walking 2.5 feet. Define a function named feet_to_steps that takes a float as a parameter, representing the number of feet walked, and returns an integer that...


A pedometer treats walking 1 step as walking 2.5 feet. Define a function named feet_to_steps that takes a float as a parameter, representing the number of feet walked, and returns an integer that represents the number of steps walked. Then, write a main program that reads the number of feet walked as an input, calls function feet_to_steps() with the input as an argument, and outputs the number of steps.


Use floating-point arithmetic to perform the conversion.


Ex: If the input is:


150.5


the output is:


60


The program must define and call the following function:
def feet_to_steps(user_feet)



my code(python):


def feet_to_steps(user_feet):
    steps = user_feet / 2.5
    return steps


if __name__ == '__main__':
    user_feet = float(input())
print(round(feet_to_steps(user_feet)))


How do I pass the unit test?


1: Compare output a<br>2/2<br>Input<br>150.5<br>Your output<br>60<br>2: Compare output a<br>2/2<br>Input<br>10000<br>Your output<br>4000<br>3: Unit test ^<br>0/3<br>feet_to_steps(11)<br>4: Unit test ^<br>0/3<br>feet_to_steps(79.25)<br>

Extracted text: 1: Compare output a 2/2 Input 150.5 Your output 60 2: Compare output a 2/2 Input 10000 Your output 4000 3: Unit test ^ 0/3 feet_to_steps(11) 4: Unit test ^ 0/3 feet_to_steps(79.25)

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here