0% found this document useful (0 votes)
2 views2 pages

1st Assignment Conditional

The document outlines a series of programming tasks in Python focused on conditional statements, including basic if-else, nested if-else, and elif statements. Each task requires the creation of a program to perform specific checks or calculations, such as determining if a number is positive or negative, classifying triangles, and calculating grades based on scores. The tasks are designed to enhance understanding of control flow in Python programming.

Uploaded by

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

1st Assignment Conditional

The document outlines a series of programming tasks in Python focused on conditional statements, including basic if-else, nested if-else, and elif statements. Each task requires the creation of a program to perform specific checks or calculations, such as determining if a number is positive or negative, classifying triangles, and calculating grades based on scores. The tasks are designed to enhance understanding of control flow in Python programming.

Uploaded by

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

Basic If-Else Statements:

1. Write a Python program to check if a given number is positive or negative.


2. Create a program that determines if a person is eligible to vote based on their
age.
3. Develop a program to find the maximum of two numbers using if-else statements.
4. Write a Python script to classify a given year as a leap year or not.
5. Create a program that checks whether a character is a vowel or a consonant.
6. Implement a program to determine whether a given number is even or odd.
7. Write a Python function to calculate the absolute value of a number without
using the `abs() function.
8. Develop a program that determines the largest of three given numbers using if-
else statements.
9. Create a program that checks if a given string is a palindrome.
10. Write a Python program to calculate the grade based on a student's score.

Nested If-Else Statements:

11. Write a program to find the largest among three numbers using nested if-else
statements.
12. Implement a program to determine if a triangle is equilateral, isosceles, or
scalene.
13. Develop a program that checks if a year is a leap year and also if it is a
century year.
14. Write a Python script to determine if a number is positive, negative, or zero.
15. Create a program to check if a person is a teenager (between 13 and 19 years
old).
16. Develop a program that determines the type of angle based on its measure
(acute, obtuse, or right).
17. Write a Python program to calculate the roots of a quadratic equation.
18. Implement a program to determine the day of the week based on a user-provided
number (1 for Monday, 2 for Tuesday, etc.).
19. Create a program that determines if a year is a leap year and also if it is
evenly divisible by 400.
20. Develop a program that checks if a given number is prime or not using nested
if-else statements.

Elif Statements:

21. Write a Python program to assign grades based on different ranges of scores
using elif statements.
22. Implement a program to determine the type of a triangle based on its angles.
23. Develop a program to categorize a given person's BMI into underweight, normal,
overweight, or obese using elif statements.
24. Create a program that determines whether a given number is positive, negative,
or zero using elif statements.
25. Write a Python script to determine the type of a character (uppercase,
lowercase, or special) using elif
statements.
26. Implement a program to calculate the discounted price based on different
purchase amounts using elif statements.
27. Develop a program to calculate the electricity bill based on different
consumption slabs using elif statements.
28. Create a program to determine the type of quadrilateral based on its angles and
sides using elif statements.
29. Write a Python script to determine the season based on a user-provided month
using elif statements.
30. Implement a program to determine the type of a year (leap or common) and month
(30 or 31 days) using elif statements.

You might also like