Assignment_3
Assignment_3
6. Write a python program to Identifying the largest number among three numbers and print the largest
one.
8. Write a python program to check the user belong to which age group. (Ex. Toddler, teenager, adult,
senior citizen.)
9. Write a python program to check if two variables point to the same object in memory, using is and is
not operator.
11. Write a program that checks if a number num is a multiple of 5. Return True if it is a multiple,
otherwise return False.
12. Write a python program to check eligibility based on age and height.
13. Write a python program that determines loan eligibility based on the following conditions:
• If income is greater than 50,000 and credit score is above 700, they are eligible.
• If income is between 30,000 and 50,000, they are eligible only if: Their credit score is above
750 or they have been employed for more than 5 years.
• If income is less than 30,000, they are not eligible.
14. Write a Python program that takes a word as input and categorizes the word based on length:
15. Write a program that compares the sum of digits of two integers n1 and n2.
16. Write a Python program that takes three integers representing a day, month, and year. The program
should check if this date is valid considering:
• The day is valid for the given month and year (accounting for leap years).
1
Centre for Data Science
Institute of Technical Education & Research, SOA, Deemed to be University
17. Create a program that asks the user for the total purchase amount and applies a discount:
18. Create a number guessing game where the program generates a random number between 1 and 100.
The user must guess the number, and the program gives hints like ”Too high” or ”Too low” until the
correct number is guessed.
19. Write a program that calculates the Body Mass Index (BMI) given a person’s weight (in kg) and
height (in meters) and classifies the result according to these ranges:
20. Write a program that takes a number (1–7) as input and prints the corresponding day of the week (1
= Sunday, 2 = Monday, etc.). If the input is not within 1–7, print Invalid day.
21. Write a program that calculates the shipping cost based on the weight of a package and the shipping
method:
Take the weight and shipping method as input, and print the total cost.
22. Write a program that takes an integer and classifies it based on these nested conditions:
If the number is divisible by 2, check if it’s also divisible by 3:
• If yes, print Divisible by both 2 and 3.
• If no, print Divisible by 2 but not by 3.
If the number is divisible by 3 but not by 2, print Divisible by 3 but not by 2.
If the number is not divisible by either, print Not divisible by 2 or 3.