Functions Quiz 2

Share with others

Welcome to your Functions Quiz 2

Q11. The function can be called in the program by writing function name followed by ________________

Q12. def cal(n1) : What is n1?

Q13. cal(n1) : What is n1?

Q14. Write the output of the following:

def s(n1):
      print(n1)
n2=4
s(n2)

Q15. Which of the following statement will execute in last?:

def s(n1): #Statement 1
      print(n1) #Statement 2
n2=4 #Statement 3
s(n2) #Statement 4

Q16. Choose the correct answer

def s(n1): 
      print(n1) 
n2=4 
s(n2) 

Statement A : n1 and n2 have same memory Address
Statement B : both n1 and n2 are referring to the same value, so they  have same identity

Q17. Write the output of the following :

def s(n1):

     print(n1)

     n1 = n1 +2

n2=4

s(n2)

print(n2)

Q18. Consider the following code and choose the incorrect statement.:

def s(n1):

      print(id(n1))

n2=4

s(n2)

print(id(n2))

Q19. Write the output of the following:

def cal(m,n):

     if m==n:

          return m*3

     else:

          return m*2

s = cal(9, 8)

print(s)

Q20. Write the output of the following:

def cal(m,n):

     if m==n:

          return m*3

     else:

          return n*2

s = cal("Amit", "Anuj")

print(s)


Share with others

Leave a Reply

error: Content is protected !!