Q2Single correct3 Marks13 Apr 2025
A system categorizes students based on their marks as follows:
Marks Range Category Table (Rendered in LaTeX):
Fail
Pass
Good
Excellent
Which of the following snippets correctly computes and prints the category after accepting the marks as input? Assume that the input entered by the user will be an integer and will lie only in the range .
Snippet-1:
marks = int(input())
```
A system categorizes students based on their marks as follows:
Marks Range Category Table (Rendered in LaTeX):
Fail
Pass
Good
Excellent
Which of the following snippets correctly computes and prints the category after accepting the marks as input? Assume that the input entered by the user will be an integer and will lie only in the range .
Snippet-1:
marks = int(input())
if marks < 40:
category = 'Fail'
elif marks < 60:
category = 'Pass'
elif marks < 80:
category = 'Good'
else:
category = 'Excellent'
print(category)
Snippet-2:
marks = int(input())
if marks <= 40:
category = 'Fail'
elif marks <= 60:
category = 'Pass'
elif marks <= 80:
category = 'Good'
else:
category = 'Excellent'
print(category)
```