Sei sulla pagina 1di 1

INDIAN SCHOOL MUSCAT

CLASS XII
(2020-2021)
COMPUTER SCIENCE (Code 083)
WS 1 – FUNCTIONS 1
Attempt the following questions in the class work note book:

1. What is a function? How is it useful?


2. What is an argument? Give an example?
3. Find the error:
def minus(total, decrement)
output=total-decrement
return output
4. From the program code given below identify the parts mentioned below:
def processnumber(x):
x=72
return x+3
y=54
res=processnumber(y)
Identify these parts: function header, function call, arguments, parameters,
function body, main program
5. Write a function called calculate_area() that takes base and height as input
arguments and return area of triangle as an output.(AREA=1/2*base*height)

Potrebbero piacerti anche