Functions NCERT Solution || Functions Class 11 Solution || Functions Python Class 11 CS Solution || Functions Computer Science Solution || NCERT Functions Solution || Functions in Python Class 11 CS || Functions in Python Solution
Note:- Please Click on Question to get the Answer !!
Q1. 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
Q2. How is math.ceil(89.7) different from math.floor (89.7)?
Q3. Out of random() and randint(), which function should we use to generate random numbers between 1 and 5. Justify.
Q4. How is built-in function pow() function different from function math.pow() ? Explain with an example.
Q5. Using an example show how a function in Python can return multiple values.
Q6. Differentiate between following with the help of an example:
(a) Argument and Parameter
(b) Global and Local variable
Q7. Does a function always return a value? Explain with an example.
hi
ReplyDeletethis question you provide will come in exam ?
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )