Programs
Write a Python Program to:
1. Check whether the year input by the user is a leap year or not.
Hint: A year is a leap year only if the year is a multiple of 4
2. Calculate the area of square or circle according to the given input by
the user. If the input is 1, then calculate the area of a square, else
find the area of a circle.
3. Find whether the given character is a vowel or not.
4. Input three numbers from the user, then print ‘You won’ if the sum
of input numbers is greater than 1000.
5. To check whether a given number is 2-digit number, 3-digit number
or 4-digit number.
6. To accept the age of a person and check whether he is a senior
citizen or not.
7. To accept the price and quantity of a product. Calculate and display
the following.
a. Total amount
b. Discount
Total Amount≥₹1000 Discount is ₹100
Total Amount<₹1000 Discount is ₹50
8. To perform basic operations (sum, difference, product, quotient and
reminder) depending on the operator entered by the user.
9. To display the product to be purchased depending upon the table of
information.
Money received Item to purchase
More than or equal 100 Cake
Less than 100 but more than 10 Chocolate
Less than 10 Candy
10. To accept the length and breadth of a rectangle from the user.
Display the area of the rectangle if the choice entered by the user is
1 otherwise display the perimeter of the rectangle.
11. A shopping mall offers the following discounts to the
customers.
Bill Amount Discount
More than equal to 150Dh but AED 50
less than 200Dh
More than equal to 200Dh but AED 75
less than 300Dh
More than 300Dh AED 95
Display the total amount and the amount needs to be paid after the
discount.