No student devices needed. Know more
23 questions
Which keyword is used for function?*
define
fun
def
function
Which of the following items are present in the function header?
function name
parameter list
return value
Both A and B
If the return statement is not used inside the function, the function will return:
0
None
Null
Arbitary value
What is a recursive function?
A function that calls other function.
A function which calls itself.
Both A and B
None of the above
Which of the following function headers is correct?*
def fun(a = 2, b = 3, c)
def fun(a = 2, b, c = 3)
def fun(a, b = 2, c = 3)
def fun(a, b, c = 3, d)
In which part of memory does the system store the parameter and local variables of a function call?
heap
stack
Uninitialized data segment
None of the above
How is a function declared in Python?*
def function function_name():
declare function function_name():
def function_name():
declare function_name():
Which one of the following is the correct way of calling a function?
function_name()
call function_name()
ret function_name()
function function_name()
Which of the following functions is a built-in function in python?
array()
sqrt()
factorial()
print()
What will be the output of the following Python expression? round(4.576)
4.5
5
4
4.6
What will be the output of the following Python expression? round(4.5676,2)
4.5
4.6
4.57
4.56
A Python module is a file with the _____ file extension that contains valid Python code.
.pym
.pymodule
.module
.py
What is returned by math.ceil(3.4)?
3
4
4.0
3.0
Which statement is correct to import all modules from the package
from package import all
from package import *
from package include all
from package include *
______ is a string literal denoted by triple quotes for providing the specifications of certain program elements.
Which of the following is not a valid namespace?
Global namespace
Public namespace
Built-in namespace
Local namespace
What is the order of namespaces in which Python looks for an identifier?
Python first searches the global namespace, then the local namespace and finally the built-in namespace
Python first searches the local namespace, then the global namespace and finally the built-in namespace
Python first searches the built-in namespace, then the global namespace and finally the local namespace
Python first searches the built-in namespace, then the local namespace and finally the global namespace
The collection of modules and packages that together cater to a specific type of applications or requirements, is called______
module
library
classes
documentation
The help statement display ___ from a module.
constants
functions
classes
docstrings
10#40#70#
30#40#50#
50#60#70#
40#50#70#
a=10
a=20
syntax error
value error
Explore all questions with a free account