Python
Assignment Sheet-1 (Introduction)
1. Write a program in Python to print “This is my first program in Python”.
2. Write a program in Python where we take two integers as input and perform all
arithmetic operations (Addition, Subtraction, Multiplication, Division, and Modulo
Division). Then display all the results.
3. Write a program in Python where we take two float as input and perform all
arithmetic operations (Addition, Subtraction, Multiplication, Division, and Modulo
Division). Then display all the results.
4. Write a program in Python to calculate the simple interest.
[ I=P*T*R/100 ]
5. Write a program in Python to calculate the compound interest.
[ P+I=P*(1+R/100)^T ]
6. Write a program in Python to swap between two integers with a temporary variable.
7. Write a program in Python to swap between two integers without any temporary
variable.
8. Write a program in Python where take an integer as input and print the number table
of that integer. (Without using any loop)
9. Write a program in Python where we take two integers as input and perform integer
division and float division operation between them separately. Then print the
division result separately.
10. Write a program in Python to convert a Celsius temperature to equivalent
Fahrenheit temperature.
11. Write a program in Python to convert a Fahrenheit temperature to equivalent
Celsius temperature.
12. Write a program in Python where we take the length & breadth of a rectangle as
input and then find the perimeter and area of it.
13. Write a program in Python where we take the radius of a circle as input and then
find the perimeter and area of it.
Rajib Sengupta (ICEI) 7980170785
Python
14. Write a program in Python where we take the length of three sides of a triangle as
input and then find the perimeter and area of it.
15. Write a program in Python where we take the length of three sides of a triangle as
input and then find the triangle formation is possible or not.
Rajib Sengupta (ICEI) 7980170785
Python
Assignment Sheet-2
(Operators, Decision Control, Branching)
1. Write a program in Python to perform the following operation on a three digit
number (Without Loop) –
(i) Reverse
(ii) Sum of Digits
(iii) Palindrome Check
2. Write a program in Python to check a year is leap year or not, by using the nested
decision control.
3. Write a program in Python to check a year is leap year or not, by using the ternary
operator.
4. Write a program in Python to generate a mark sheet with individual marks of all
subjects, total, average and letter grade/division. (Use Multiple If_Else)
5. Write a program in Python to find out the maximum and minimum between three
integers inputted by user.
6. Write a program in Python to generate a telephone bill based on following
information –
(i) Fixed Rental charge = Rs. 250
(ii) First 50 calls charge = Nil
(iii) Next 100 calls charge @ 0.80 per call.
(iv) Next 250 calls charge @ 1.00 per call.
(v) Next 600 calls charge @ 1.20 per call.
(vi) Above 1000 calls charge @ 1.50 per call.
Bill Amount = Rental Charge + Call Charge + VAT (4% of call charge)
7. Write a program in Python prepare a salary sheet based on following information –
* Income Heads –
(i) Basic
(ii) D.A. (50% of Basic)
(iii) H.R.A. (20% of Basic)
Rajib Sengupta (ICEI) 7980170785
Python
(iv) Medical Allowance = 500/- (fixed)
* Gross Salary = Basic + DA + HRA +MA
* Expenditure Heads
(i) PF (12% of Basic)
(ii) ESI (6% of Basic) (If Gross Salary<15000)
(iii) P.Tax = 200/- (Fixed)
* Net Salary = Gross Salary – Total Expenditure
8. Write a program in Python to check a user inputted number is even or odd. (Using
Simple decision control)
9. Write a program in Python to check a user inputted number is even or odd. (Using
ternary operator)
10. Write a program to find the sum of the integer part and fraction part separately.
(Example – Input : 123.456 then Output : 6.15)
11. Write a program in Python to generate the following –
Input – 52936
Output –
Left to Right Right to Left
5 6
2 3
9 9
3 2
6 5
Rajib Sengupta (ICEI) 7980170785