Wednesday, March 12, 2025

How to Calculate Net salary in Python

 13. bpay=4560, Calculate da=16%, hra=12%, oa=8%,it=3%, & net


basicpay=4560

da=basicpay*0.16

hra=basicpay*0.12

oa=basicpay*0.08

it=basicpay*0.03

net=basicpay+da+hra+oa-it

print('Net Salary ',net) #Net Salary  6064.8





Tuesday, March 11, 2025

Python program for Calculate area & circumference of Circle, area of Cylinder & volume of Cylinder, Sphere Volume

 10. Python program for Calculate area and circumference of Circle. r=5


r = 5

pi = 3.14

area=r*r*pi

circumference = 2 * r * pi

print("The Area is ", area) # The Area is 78.5

print("The Circumference is ", circumference) # The Circumference is 31.400000000000002





import math

r = 5

area=r*r*math.pi
circumference = 2 * r * math.pi
print("The Area is ", area ) # The Area is  78.53981633974483
print("The Circumference is ", circumference) # The Circumference is  31.41592653589793




11. Python program for Calculate area of Cylinder. r=9.7, h=5.3 area=2x3.14rh and  volume   of Cylinder

pi = 3.14
r=9.7
h=5.3 
area=2*pi*r*h 
volume=pi*r*r*h
print("The Area is ", area ) # The Area is   322.85479999999995
print("The Volume is ", volume ) # The Volume is 1565.8457799999999




import math

r=9.7
h=5.3 
area=2*math.pi*r*h 
volume=math.pi*r*r*h
print("The Area is ", area ) # The Area is 323.0185566421025
print("The Volume is ", volume ) # The Volume is 1566.639999714197




12. Python program for Sphere Volume 4/3.0 pirrr    r=8.3  

pi = 3.14
r=8.3
volume=pi*r*r*r
print("The Volume is ", volume ) # The Volume is 1795.4111800000007



import math
r=8.3
volume=math.pi*r*r*r
print("The Volume is ", volume ) # The Volume is 1796.3218386181475





Python programs. Area of Rectangle, Area of Triangle, Temperature Conversion, Bill and Electricity Bill

 

05. Calculate area of Rectangle. l=5.3, b=2.7

l=5.3

b=2.7

area=l*b

print('Area of Rectangle : ',area) #Area of Rectangle :  14.31



06. Calculate area of Triangle. b=8.3, h=6.7

l=8.3

b=6.7

area=l*b

print('Area of Triangle : ',area) #Area of Triangle :  55.61000000000001



07. C=(f-32)*5/9  Temp. Conversion f=92


f=92

c=(f-32)*5/9

print('Centigrade : ',c)  #Centigrade :  33.333333333333336



08. Quantity=15, Rate=5.25, Calculate Bill

quantity=15
rate=5.25
bill=quantity * rate
print('Bill : ',bill) #Bill :  78.75



09. Calculate Electricity Bill. LMR=101, CMR=147, Rate=1.45, Calculate Units & Bill

lmr=101
cmr=147
rate=1.45
units=cmr-lmr;
bill=units*rate;
print('Units : ',units) # Units :  46
print('Bill  : ',bill)  # Bill  :  66.7






Monday, March 10, 2025

Python program for Calculate Simple Arithmetic Operation Programs in Python.

 2. Write a Program to calculate simple Arithmetic Operation. where a is 5 and b is 2



a = 5

b = 2

print('Addition  of a & b : ',a + b) # Addition  of a & b : 7

print('Subtract  of a & b : ',a - b) # Subtract  of a & b : 3

print('Multiply    a by b : ',a * b) # Multiply    a by b : 10

print('Divided     a by b : ',a / b) # Divided     a by b : 2.5






03.Calculate the Total and Average of Three subject marks
m1=45, m2=56,m3=45


m1=45
m2=56
m3=45
total=m1+m2+m3
avg=total/3.0
print('Total Marks : ',total) #Total Marks : 146
print('Average : ',avg) #Average : 48.666666666666664





04. Calculate Simple Interest.       p=1000 n=5   r=2.5

p=1000
n=5
r=2.5
si=p*n*r/100
print('Simple Interest : ', si) #Simple Interest :  125.0













First Python Program print String (Name)

 1. Write a Python Program to print String.


     print('Hello Python')

Result  

  Hello Python



How to Calculate Net salary in Python

  13. bpay=4560, Calculate da=16%, hra=12%, oa=8%,it=3%, & net basicpay=4560 da=basicpay*0.16 hra=basicpay*0.12 oa=basicpay*0.08 it=basi...