Python Lab Notebook
Python Lab Notebook
import math
radius = float(input("Enter radius of the circle: "))
area = math.pi * radius ** 2
print("Area:", area)
3. Accept a number from keyboard and test whether the given number is even or odd.
i = 1
while i <= 10:
print(i)
i += 1
Output: 1
2
3
4
5
6
7
8
9
10
my_list = [1, 2, 3, 4, 5]
for item in my_list:
print(item)
Output: 1
2
3
4
5
import math
num = int(input("Enter a number: "))
print("Factorial:", math.factorial(num))