Pract3
Pract3
Practical No. 3: Write simple Python program using operators: Arithmetic Operators, Logical Operators, Bitwise
Operators
Name: Ritesh Doibale Roll no:41
Practical code:
Arithmetic Operator:
d=a-b
print(f"Substraction {a}-{b}={d}")
e=a*b
print(f"Multiplication {a}*{b}={e}")
f=a/b
print(f"Division {a}/{b}={f}")
g=a%b
print(f"Modulus {a}%{b}={f}")
g=a//b
print(f"floor division {a}//{b}={f}")
Output:
Subject: PWP[22616]
Practical No. 3: Write simple Python program using operators: Arithmetic Operators, Logical Operators, Bitwise
Operators
Name: Ritesh Doibale Roll no:41
Logical Operator:
Code:
Bitwise Operator:
Code:
1Code:
2Code:
Output:
3Code:
5Code:
6Code:
import math
print("program to calculate surface volume and area of a cylinder. \n")
radius = float(input("Enter the radius of the cylinder: "))
height = float(input("Enter the height of the cylinder: "))
print("\nCylinder Surface Area:", 2 * math.pi * radius * (radius + height) )
print("Cylinder Volume:", math.pi * radius**2 * height)
Output:
Subject: PWP[22616]
Practical No. 3: Write simple Python program using operators: Arithmetic Operators, Logical Operators, Bitwise
Operators
Name: Ritesh Doibale Roll no:41
7Code:
temp =i
i=j
j=temp
Output: