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

25th Apr 2024, 1:44 PM
Yousef Elsadig Yousef
Yousef Elsadig Yousef - avatar
5 odpowiedzi
+ 4
Where is your *tried* solution? Also question is incomplete..
25th Apr 2024, 2:40 PM
Jayakrishna 🇮🇳
+ 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))
25th Apr 2024, 6:37 PM
BroFar
BroFar - avatar
+ 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()
25th Apr 2024, 4:47 PM
Yousef Elsadig Yousef
Yousef Elsadig Yousef - avatar
+ 1
Yes. Your total output (visible on console), should match with expected output test cases. No extra or less character(s), including spaces .
27th Apr 2024, 3:22 AM
Jayakrishna 🇮🇳
+ 1
steps = int(input("")) active_minutes = int(input("")) goal_achived=steps >= 10000 or active_minutes >= 30 print(goal_achived)
27th Apr 2024, 12:31 PM
Mokshit
Mokshit - avatar