Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Assignment List-02

Subject :- Computer Science with Python


Class : XI [if..else and nested if else]

[by using if….else statement only]


1. Write a PYTHON program to find maximum between two numbers.

2. Write a PYTHON program to check whether a number is divisible by 5 and 11


or not.
3. Write a PYTHON program to check whether a number is even or odd.

4. Write a PYTHON program to check whether a year is leap year or not.

5. Python Program to check character is Alphabet , Digit or Special


Character…
6. Write a PYTHON program to check whether a character is uppercase or
lowercase alphabet.

7. A shop will give discount of 10% if the cost of purchased quantity is more than 1000.
Ask user for quantity Suppose, one unit will cost 100. Judge and print total cost for
user.
8. A company decided to give bonus of 5% to employee if his/her year of service is more
than 5 years. Ask user for their salary and year of service and print the net bonus
amount.

9. Write a program to find highest number between 3 numbers input by user.


10. Write a program to check whether the triangle is equilateral, isosceles or
scalene triangle.

11 .] Write a program to input marks of five subjects Physics, Chemistry, Biology,


Mathematics and Computer. Calculate percentage and grade according to following:
The grade is assigned using the following rules:
Percentage Grade
90 and above A
80 to 89 B
60 to 79 C
33 – 59 D
below 33 F
10. Write a PYTHON program to input basic salary of an employee and
calculate its Gross salary according to following:
Basic Salary <= 10000 : HRA = 20%, DA = 80%
Basic Salary <= 20000 : HRA = 25%, DA = 90%
Basic Salary > 20000 : HRA = 30%, DA = 95%

11. Write a program to calculate BMI of a person after inputting its weight in
kgs and height in meters and then print the nutritional status as per
following table : The formula is BMI = kg/m2

Nutritional Status WHO criteria BMI cut-off


Under weight < 18.5
Normal 18.5 – 24.9
Overweight 25 - 29.9
Obese >= 30
12] Write a program to accept the cost price of a bike and display the road tax to be
paid according to the following criteria :

Cost price (in Rs) Tax


> 100000 15 %
> 50000 and <= 100000 10%
<= 50000 5%
13]. Accept the kilometers covered and calculate the bill according to the following
criteria:
First 10 Km Rs11/km
Next 90Km Rs 10/km
After that Rs9/km

14. Write a program to check whether the triangle is equilateral, isosceles or


scalene triangle.

You might also like