3-Write a program in Python to check whether the students are qualified for the
final round of Inter School Quiz Competition if they score above than 45 marks
out of 50 in preliminary round
Answers
Answered by
2
Solution:
The given problem is solved in Python.
score = float(input('Enter your score out of 50: '))
if score > 45:
print('You are eligible.')
else:
print('You are not eligible.')
Explanation:
- Logic for the program is very simple. We ask the user to enter the score. The marks is then stored inside a variable (Line 1)
- Now, we check whether score > 45 is true or not using if statement (Line 2).
- If the condition is true, program prints You are eligible. (Line 3)
- If the condition is false, the else block executes and prints You are not eligible. (Line 4, 5).
- Hence, our problem is solved.!!
Refer to the attachment for output.
Attachments:
Similar questions
Math,
2 months ago
Science,
2 months ago
Social Sciences,
5 months ago
Social Sciences,
5 months ago
Math,
10 months ago
Computer Science,
10 months ago
Math,
10 months ago