Python Practical File
1. Check Whether a Number is Positive, Negative or Zero
num = -5
# Output: Negative
2. Print Even Numbers from List
l1 = [1, 2, 3, 4, 5, 6]
# Output: [2, 4, 6]
3. Find Average and Grade from Marks
marks = [88, 92, 76, 81, 95]
# Average: 86.4, Grade: B
4. Age Category from User Input
age = 25
# Output: Adult
5. Calculate Sale Price
cost = 1000
discount = 10 # percent
# Sale Price: ₹900.0
6. Area and Perimeter of Shapes
# Triangle: Perimeter = 12, Area = 6.0
# Rectangle: Perimeter = 16, Area = 15
# Square: Perimeter = 16, Area = 16
# Circle: Circumference = 18.85, Area = 28.27
7. Simple and Compound Interest
P = 10000, R = 5, T = 2
# SI = ₹1000.0, CI = ₹1025.0
8. Profit or Loss
Cost Price = ₹1500, Selling Price = ₹1200
# Output: Loss: ₹300
9. EMI Calculation
Principal = ₹50000, Rate = 10%, Time = 12 months
# EMI = ₹4395.79
10. Tax Calculation
Amount = ₹50000
# GST (18%) = ₹9000.0, Income Tax (10%) = ₹5000.0
11. Largest and Smallest in a List
List = [4, 1, 9, 2, 7]
# Max: 9, Min: 1
12. Third Largest and Smallest in a List
List = [10, 20, 5, 8, 30, 20]
# 3rd Largest = 10, 3rd Smallest = 10
13. Sum of Squares of First 100 Natural Numbers
# Output: 338350
14. First ‘n’ Multiples of a Given Number
Number = 5, n = 10
# Output: [5, 10, 15, 20, 25, 30, 35, 40, 45, 50]
15. Count Vowels in a String
String = "Hello World"
# Output: 3 vowels