0% found this document useful (0 votes)
11 views2 pages

Python Practical File

The document outlines various Python practical exercises including checking if a number is positive, negative, or zero, printing even numbers from a list, calculating average and grades from marks, and determining age categories. It also covers calculations for sale prices, areas and perimeters of shapes, simple and compound interest, profit or loss, EMI, tax calculations, and finding largest/smallest values in lists. Additional tasks include calculating the sum of squares of natural numbers, generating multiples of a number, and counting vowels in a string.

Uploaded by

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

Python Practical File

The document outlines various Python practical exercises including checking if a number is positive, negative, or zero, printing even numbers from a list, calculating average and grades from marks, and determining age categories. It also covers calculations for sale prices, areas and perimeters of shapes, simple and compound interest, profit or loss, EMI, tax calculations, and finding largest/smallest values in lists. Additional tasks include calculating the sum of squares of natural numbers, generating multiples of a number, and counting vowels in a string.

Uploaded by

awanamukul47
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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

You might also like