0
There is a Python test on Solularen, but I did not find the correct solution.
Test, Complete the code to output True if the user has achieved the daily fitness goal, and False otherwise steps = 10035 active_minutes = 15 True steps = 9850 active_minutes = 45 True steps = 9850 active_minutes = 25 False The code # Take steps and minutes as inputs steps = int(input()) active_minutes = int(input()) # Store the result of the operations in the variable goal_achieved = # Display the result on the screen
5 odpowiedzi
+ 4
Where is your *tried* solution?
Also question is incomplete..
+ 2
Joseph Adam this is a python exercise where as you are not specifically asking users for input ... The inputs are hidden per test therefore it is
steps = int(input())
and
active_minutes = int(input())
Using your code
def achieve_fitness_goal(steps, active_minutes):
return steps > 10000 or active_minutes > 30
# Test the function
steps = int(input())
active_minutes = int(input())
print(achieve_fitness_goal(steps,active_minutes))
+ 1
def achieve_fitness_goal():
steps = int(input("Enter the number of steps: "))
active_minutes = int(input("Enter the number of active minutes: "))
return steps > 10000 or active_minutes > 30
# Test the function
print(achieve_fitness_goal()
+ 1
Yes. Your total output (visible on console), should match with expected output test cases.
No extra or less character(s), including spaces .
+ 1
steps = int(input(""))
active_minutes = int(input(""))
goal_achived=steps >= 10000 or active_minutes >= 30
print(goal_achived)