WORKSHEET – 1.
Name: Gurman Singh Section: 705-A
UID: 20BCS5111
Question 1:
Write a python program to calculate the area of 10 different circles. Given the
pie = 22/7 and radius of the circles entered by the user using Simple Function,
Parameterized Function, Return Type with function and return type with
parameterized Functions.
CODE:
def area_of_circle(radius):
a = 3.14 * radius * radius
return a
for i in range(0, 10):
print("Enter the radius of circle ", i+1, " : ",
end="")
radius = int(input())
print("Area of circle ", i+1, " : ",
area_of_circle(radius))
print("=====================")
OUTPUT:
Question 2:
Write a python program to print Multiplication tables from 2 to 20 whether
table values entered by the user using Simple Function, Parameterized
Function, Return Type with function and return type with parameterized
Functions.
CODE:
def table(n):
for i in range(1, 11):
print(n, " x ",i ," = ", n*i)
t = int(input("Enter the number between 2 to 20: "))
table(t)
OUTPUT: