Font size
WorksheetsCHAPTER - 4 Python libraries
Total questions: 27
Worksheet time: 27mins
1.______ is a string literal denoted by triple quotes for
providing the specifications of certain program elements.
a)Interface
b)Modularity
c) Docstring
d)Client
2. Which of the following functions is a built-in function in
python?
a) seed()
b) sqrt()
c) factorial()
d) print()
3.What are the outcomes of the following functions?
chr(‘97’)
chr(97)
a) a and Erro
b) ‘a’
c) Error
d) Error and a
4.Which of the following functions does not throw an error?
a) ord()
b) ord(‘ ‘)
c) ord(”)
d) ord(“”)
What is meant by module in python?
6.Give an real time example for modularity.
7. (a) which function helps to display all information including docstring ,function name and constant in a module.
8.What is a library in python?
COLLECTION OF FILES
COLLECTION OF MODULES
IT IS SUBPROGRAM
NAME OF A FILE
9.exp(),floor()belongs which module?
cmath.py
urlib.py
math.py
statistics.py
10.Which operator is used in python to import all modules from package
-- operator
+ operator
operator
----> operator
11.A variable defined inside the def() we called as
Global
enclosing
local
local to def()
12What will be the output of the following
from import factorial
print(math.factorial(5))
25
10
120
error bcz factorial is not a module in math
13.Which of the statements is used to import all names from a module into the current calling module
import
from
dir()
import*
14 .What is the extension of python library modules?
.mod
.lib
.code
.py
15 .In python which is the correct method to load a module math?
include math
import math
#include<math.h>
using math
2
11
2
21
2
3
11
2
3
21
Which of the following items are present in the function header?
Function name only
Both function name and parameter list
parameter list only
Return value
Which of the following keywords marks the begining of the function block?
Func
define
def
function
What Is The Output Of The Following Code Snippet?
def func(message, num = 1):
print(message * num)
func('Welcome')
func('Viewers', 3)
Welcome
Viewers
Welcome
ViewersViewersViewers
Welcome
Viewers,Viewers,Viewers
Welcome
what is a variable defined outside all the function referred to as?
A static variable
A global variable
A local variable
An automatic variable
The values passed through a function call statement are called
(a)
The parameters could be a
Variable
Literal
Expression
Function
What types of values remain unaffected during function call statement?
Mutable objects
Immutable objects
Literal
Variables
The string enclosed in triple quotes is called the doc string. It is used to
Show the documentation about the function
be read by the developer reading the function code
