0% found this document useful (0 votes)
11 views3 pages

Worksheet - 1.3: Name: Gurman Singh Section: 705-A UID: 20BCS5111

The document is a student worksheet that contains two programming questions. For the first question, the student wrote a Python program to calculate the area of 10 circles using different function types, taking the radius as input from the user. For the second question, the student wrote a program to print the multiplication table of a number between 2-20 that is input by the user, again using different function types. The student included the code and output for each question.

Uploaded by

Harshit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Worksheet - 1.3: Name: Gurman Singh Section: 705-A UID: 20BCS5111

The document is a student worksheet that contains two programming questions. For the first question, the student wrote a Python program to calculate the area of 10 circles using different function types, taking the radius as input from the user. For the second question, the student wrote a program to print the multiplication table of a number between 2-20 that is input by the user, again using different function types. The student included the code and output for each question.

Uploaded by

Harshit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

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:

You might also like