Write a python program to check whether a given number is greater than or less than 400
Answers
Answered by
5
Solution:
The given problem is solved in Python.
number = int(input('Enter a number: '))
if number > 400:
print('The number you entered is greater than 400.')
elif number < 400:
print('The number you entered is less than 400.')
else:
print('The number you entered is equal to 400.')
Explanation:
- Line 1: Accepts the number from the user.
- Line 2-3: Check if the number is greater than 400. If true, print the message that The number is greater than 400.
- Line 4-5: If not, check if the number is less than 400. If true, print the message that The number is less than 400.
- Line 6-7: If not true, check if the number is equal to 400. If true, print the message that The number is equal to 400.
Refer to the attachment for output.
Attachments:
anindyaadhikari13:
Thanks for the brainliest ^_^
Similar questions