INTERNAL ASSESSMENT – PRACTICAL
Subject: Computer Studies
Topic: Ch8: Python – Conditional
Statements
Grade: VII
Div:
_______
Roll No:
_____________________
Name:
Q.1. Do as directed.
Date: ____________
(a) Write a program to assign grades (A, B or C) to the students based on the marks
scored by them. The overall marks are 300.
(b) If the total marks scored by the student is greater than or equal to 250, print the
following statement (Congratulations!!! You have scored A grade).
(c) If the total marks scored by the student is greater than or equal to 200 but less
than 250, assign grade B, print the following statement (Well Done!!! You have
scored B grade).
(d) If the total marks scored by the student is less than 200, print the following
statement (Well Tried!!! You have scored C grade).
Answers
Answered by
8
Complete data:
- Total marks = 300.
- If the total marks scored by the student is greater than or equal to 250, print the statement (Congratulations!!! You have scored A grade).
- If the total marks scored by the student is greater than or equal to 200 but less than 250, assign grade B, print the statement (Well Done!!! You have scored B grade).
- If the total marks scored by the student is less than 200, print the statement (Well Tried!!! You have scored C grade).
Python program:
marks_scored=int(input()) #enter the marks scored by the student
if (marks_scored >= 250):
print("Congratulations!!! You have scored A grade")
elif (marks_scored >= 200) and (marks_scored < 250):
print("Well Done!!! You have scored B grade")
else:
print("Well Tried!!! You have scored C grade")
Note: You can omit writing marks_scored<250 in elif statement as the interpreter comes to elif only if the if statement becomes false. But, it is good to write for better understanding as a beginner.
Input:
225
Output:
Well Done!!! You have scored B grade
Learn more:
1. Ch+=2 is equivalent to
brainly.in/question/21331324
2. A CSS file cannot be linked to a web page. State True or False.
brainly.in/question/21107345
Similar questions
Math,
1 month ago
English,
3 months ago
Computer Science,
3 months ago
Geography,
10 months ago
Math,
10 months ago