Homework Assignment
Session 06 – Conditions and Loops
Questions:
1. Understanding Conditions:
a. What is the difference between if, if-else, and if-elif-else? Provide
examples for each.
2. While Loop Practice:
a. Write a Python program that asks the user to enter a number. The program
should keep doubling the number until it reaches or exceeds 1000, then print
the final value.
3. Grade Allotment System:
a. Write a Python program that asks the user to enter their marks (0-100).
b. Use if-elif-else to assign grades:
i. 90-100: A
ii. 80-89: B
iii. 70-79: C
iv. 60-69: D
v. Below 60: F
c. Print the student’s grade.
Bonus:
Modify the grade allotment program to allow multiple students to enter their marks using a
while loop.
RANCHOVATION LABS PRIVATE LIMITED
[Link]