Python Practical Programs
Python Practical Programs
Python Practical Programs
1. Area of a Circle
import math
radius = float(input("Enter the radius of the circle: "))
area = math.pi * radius * radius
print("Area of the circle:", area)
2. Simple Interest
principal = float(input("Enter principal amount: "))
rate = float(input("Enter rate of interest: "))
time = float(input("Enter time in years: "))
simple_interest = (principal * rate * time) / 100
print("Simple Interest:", simple_interest)
3. Eligibility to Vote
age = int(input("Enter your age: "))
if age >= 18:
print("You are eligible to vote.")
else:
print("You are not eligible to vote.")
8. Reverse of a Number
num = int(input("Enter a number: "))
reverse = int(str(num)[::-1])
print("Reversed Number:", reverse)
9. Traverse a List
L = [1, 2, 3, 4, 5]
for item in L:
print(item)
# Delete ‘Ronak’
L.remove('Ronak')
print("After deleting 'Ronak':", L)