0% found this document useful (0 votes)
41 views

Python Assignment-3

The document outlines 10 Python programming assignments: 1) check if angles make a valid triangle, 2) check if sides make a valid triangle, 3) determine triangle type, 4) calculate profit/loss, 5) calculate grade based on percentage of 5 subjects, 6) calculate employee gross salary based on basic salary and HRA/DA scales, 7) calculate electricity bill based on usage tiers and surcharges, 8) print an asterisk pyramid pattern, 9) print a mirrored asterisk pyramid pattern, and 10) check if a string is a palindrome without built-in functions.

Uploaded by

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

Python Assignment-3

The document outlines 10 Python programming assignments: 1) check if angles make a valid triangle, 2) check if sides make a valid triangle, 3) determine triangle type, 4) calculate profit/loss, 5) calculate grade based on percentage of 5 subjects, 6) calculate employee gross salary based on basic salary and HRA/DA scales, 7) calculate electricity bill based on usage tiers and surcharges, 8) print an asterisk pyramid pattern, 9) print a mirrored asterisk pyramid pattern, and 10) check if a string is a palindrome without built-in functions.

Uploaded by

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

Python Lab Assignment - 3 (13/09/2022)

1. Write a program to input angles of a triangle and check whether triangle is valid or not.
2. Write a program to input all sides of a triangle and check whether triangle is valid or not.
3. Write a program to check whether the triangle is equilateral, isosceles or scalene triangle.
4. Write a program to calculate profit or loss.
5. Write a program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and
Computers. Calculate percentage and grade according to following:
Percentage >= 90% : Grade A
Percentage >= 80% : Grade B
Percentage >= 70% : Grade C
Percentage >= 60% : Grade D
Percentage >= 40% : Grade E
Percentage < 40% : Grade F
6. Write a 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%
7. Write a program to input electricity unit charges and calculate total electricity bill according to the
given condition:
For first 50 units Rs. 0.50/unit
For next 100 units Rs. 0.75/unit
For next 100 units Rs. 1.20/unit
For unit above 250 Rs. 1.50/unit
An additional surcharge of 20% is added to the bill
8. Write a program to print the following pattern
*
**
***
****
*****

9. Write a program to print the following pattern


*
**
***
****
*****
10. Write a program to check whether the string is palindrome or not (without using Built in function).

You might also like