Topic: Chapter 7: Python functions (Test 1)



Topic: Chapter 7: Python functions
  • «
  • Test: 1(current)
  • «
Q.1
A named blocks of code that are designed to do one specific job is called as
A. Loop
B. Branching
C. Function
D. Block
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.2
A Function which calls itself is called as
A. Built-in
B. Recursion
C. Lambda
D. return
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.3
Which function is called anonymous un-named function
A. Lambda
B. Recursion
C. Function
D. define
Answer : Option A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.4
Which of the following keyword is used to begin the function block?
A. define
B. for
C. finally
D. def
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report
Q.5
Which of the following keyword is used to exit a function block?
A. define
B. return
C. finally
D. def
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.6
While defining a function which of the following symbol is used.
A. ; (semicolon)
B. . (dot)
C. : (colon)
D. $ (dollar)
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.7
In which arguments the correct positional order is passed to a function?
A. Required
B. Keyword
C. Default
D. Variable-length
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report
Q.8
Read the following statement and choose the correct statement(s). (I) In Python, you don’t have to mention the specific data types while defining function. (II) Python keywords can be used as function name.
A. I is correct and II is wrong
B. Both are correct
C. I is wrong and II is correct
D. Both are wrong
Answer : Option A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.9
Pick the correct one to execute the given statement successfully. if ____ : print(x, " is a leap year")
A. x%2=0
B. x%4==0
C. x/4=0
D. x%4=0
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.10
Which of the following keyword is used to define the function testpython(): ?
A. define
B. Pass
C. def
D. while
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report


  • «
  • Test: 1(current)
  • «