0% found this document useful (0 votes)
7 views1 page

Python Assignment: Loops & Conditions

The homework assignment focuses on understanding conditions and loops in Python. It includes questions on the differences between if, if-else, and if-elif-else statements, as well as tasks to write programs for doubling a number and assigning grades based on user input. A bonus task encourages modification of the grade allotment program to handle multiple students using a while loop.

Uploaded by

harshsingh26603
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Python Assignment: Loops & Conditions

The homework assignment focuses on understanding conditions and loops in Python. It includes questions on the differences between if, if-else, and if-elif-else statements, as well as tasks to write programs for doubling a number and assigning grades based on user input. A bonus task encourages modification of the grade allotment program to handle multiple students using a while loop.

Uploaded by

harshsingh26603
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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]

You might also like