Input percentage and print good if it is above 75 otherwise print work hard
It would help if you would proofread your work before you post it.
What is your question?
Read percentage and print good if is above 75 otherwise print Keep working hard
To solve this problem, we need to get the input from the user, check if the percentage is greater than 75, and print the corresponding message.
Here's a step-by-step explanation of how to write the code:
1. Prompt the user to enter the percentage by using the `input()` function.
2. Convert the input into a float using the `float()` function, since percentages can have decimal values.
3. Use an `if` statement to check if the percentage is greater than 75.
4. If the condition is true, print "good".
5. If the condition is false, print "work hard".
Now, let's write the code:
```python
percentage = float(input("Enter the percentage: ")) # Step 1
if percentage > 75: # Step 3
print("good") # Step 4
else:
print("work hard") # Step 5
```
That's it! The code will prompt the user for an input, check if it's above 75, and print the corresponding message.