+ 1
Fix the bug
# Take steps and minutes as inputs steps = int(input()) active_minutes = int(input()) # Store the result of the operations in the variable goal_achieved = False if (steps <10000) or (active_minutes < 30): goal_achieved = True # Display the result on the screen print(goal_achieved ) Please find the bug the false is not working
18 Answers
+ 3
The task cannot be solved without knowing the precise task instructions. When you ask a question, describe exactly what the task is.
Read carefully: The goal is achieved when the user has MORE than 10000 steps or MORE than 30 min of activity.
And as a side note: The part between if...: already is a boolean – you can write the code without the if statement.
+ 3
When you ask for help, read carefully what answers you get:
The goal is achieved when the user has ⭐️MORE⭐️ than 10000 steps or ⭐️MORE⭐️ than 30 min of activity.
Pay attention to the ⭐️ and fix you code accordingly.
+ 1
Show what you have tried, not your old code.
+ 1
Okay, I checked the post. Look at this:
The goal is achieved when the user has ⭐️MORE than 10000 steps or ⭐️MORE than 30 min of activity.
< means smaller than
> means greater than
0
I have tried that it's not working and that not my issue with the code if the goal is not achieved there is supposed to be a output of False but it's not working
0
That what I have tried
Please go check out my post on my profile I will post a screenshot of everything there please
0
Thanks have posted it
0
So you fixed what I have pointed out in my last comment?
0
No I have not please go Check my post you will see what am saying
0
Thanks I been able to solve it
0
The else statement is missing
0
# Take steps and minutes as inputs
steps = int(input())
active_minutes = int(input())
# Store the result of the operations in the variable
goal_achhieved = False
if (steps >=10000 or active_minutes >= 30):
goal_achieved = True
# Display the result on the screen
print(goal_achieved )
0
The code should be as follows:
Steps = int(input())
Active_minutes = int(input())
If (Steps>10000) or (Active_minutes>30):
goal_achieved = true
print(goal_achieved)
else:
goal_achieved = false
print(goal_achieved)
0
1. PLEASE READ THE PREVIOUS REPLIES BEFORE POSTING
2. It already has been solved
3. The else is not necessary
0
Welp ok
0
Rwitoban Das : your code was wrong. You used If insted of if. Python is case sensitive
0
Yes sorry here in the comments it doesnt automatically bring it to smallcase as in the coding workspace, new to this platform... still learning
0
Rwitoban Das me too brother. happy learning