0% found this document useful (0 votes)
4 views

Working With Function Assignment

The document is an assignment for students at Euro International School focusing on identifying errors in Python functions and understanding various programming concepts. It includes tasks related to function calls, mathematical functions, generating random numbers, and the differences between arguments, parameters, global and local variables. Additionally, it asks about function return values and provides examples to illustrate these concepts.

Uploaded by

kkanakk3131
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)
4 views

Working With Function Assignment

The document is an assignment for students at Euro International School focusing on identifying errors in Python functions and understanding various programming concepts. It includes tasks related to function calls, mathematical functions, generating random numbers, and the differences between arguments, parameters, global and local variables. Additionally, it asks about function return values and provides examples to illustrate these concepts.

Uploaded by

kkanakk3131
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/ 2

EURO INTERNATIONAL SCHOOL

CH-2
WORKING WITH FUNCTION
ASSIGNMENT
NAME : ROLL NO.

1. Observe the following programs carefully, and identify the error:


a) def create (text, freq):
for i in range (1, freq):
print text
create(5) #function call

b) from math import sqrt,ceil


def calc():
print cos(0)
calc() #function call

c) mynum = 9
def add9():
mynum = mynum + 9
print mynum
add9() #function call

d) def findValue( vall = 1.1, val2, val3):


final = (val2 + val3)/ vall
print(final)
findvalue() #function call
e) def greet():
return("Good morning")
greet() = message #function call
2.How is math.ceil(89.7) different from math.floor (89.7)?
3. Out of random() and randint(), which function should we use to generate
random numbers between1 and 5. Justify.
4. How is built-in function pow() function different from function math.pow() ?
Explain with an example.
5. Using an example show how a function in Python can return multiple values.
6. Differentiate between following with the help of an example:
a) Argument and Parameter
b) Global and Local variable
7. Does a function always return a value? Explain with an example.

You might also like