6.20 LAB: Step counter 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...



I need help passing the unit test.




My code(python):



def feet_to_steps(user_feet):                   # feet_to_steps function
    step = user_feet /2.5
    return step


if __name__ == "__main__":
    user_feet = float(input())     # Taking the user input.
    print(round(feet_to_steps(user_feet)))
num_of_feet = intput()
print(num_of_feet / 2.5)


6.20 LAB: Step counter<br>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,<br>representing the number of feet walked, and returns an integer that represents the number of steps walked. Then, write a main program<br>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<br>steps.<br>Use floating-point arithmetic to perform the conversion.<br>Ex: If the input is:<br>150.5<br>the output is:<br>60<br>The program must define and call the following function:<br>def feet_to_steps(user_feet)<br>

Extracted text: 6.20 LAB: Step counter 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)
2: Compare output a<br>2/2<br>Traceback (most recent call last):<br>File
num of feet intput () NameError: name 'intput' is not defined Input 10000 Your outp 4000 3: Unit test ^ 0/3 feet_to_steps(11) 4: Unit test 0/3 feet_to_steps(79.25) "/>
Extracted text: 2: Compare output a 2/2 Traceback (most recent call last): File "main.py", line 8, in num of feet intput () NameError: name 'intput' is not defined Input 10000 Your outp 4000 3: Unit test ^ 0/3 feet_to_steps(11) 4: Unit test 0/3 feet_to_steps(79.25)

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here