Python Control Structures
Python Control Structures - Important Points
36. | Which of the following statements is used to create a function in Python? |
---|
A. def function_name(arguments):
B. function function_name(arguments):
C. function_name(arguments) def:
D. function_name def(arguments):
View Answer Discuss Work SpaceAnswer: option a
Explanation:
37. | Which of the following statements is used to call a function in Python? |
---|
A. call function_name(arguments)
B. function_name.call(arguments)
C. function_name(arguments)
D. arguments(function_name)
View Answer Discuss Work SpaceAnswer: option c
Explanation:
38. | Which of the following statements is used to return a value from a function in Python? |
---|
A. return value
B. return(value)
C. value.return()
D. value(return)
View Answer Discuss Work SpaceAnswer: option a
Explanation:
39. | Which of the following statements is used to define a default value for a function argument in Python? |
---|
A. def function_name(argument=value):
B. def function_name(argument, value):
C. def function_name(argument=default(value)):
D. def function_name(argument, default=value):
View Answer Discuss Work SpaceAnswer: option a
Explanation:
40. | Which of the following statements is used to import a module in Python? |
---|
A. module.import(module_name)
B. import module_name
C. from module_name import *
D. All of the above
View Answer Discuss Work SpaceAnswer: option b
Explanation: