Documente Academic
Documente Profesional
Documente Cultură
all([2,4,6,”A”])
float(‘-infinity‘)
float(‘inf‘)
a) –infinity and inf b) –inf and inf c) Error and Error d) Error and Junk value
a) Id returns the identity of the object b) Every object doesn‘t have a unique id
def san(x):
print(x+1)
x=-2
x=4
san(15)
a) 5 b) 16 c) 2 d) -2
9. What is the output of the code shown?
def f1():
global x
x+=1
print(x)
x=12
print("x")
a) Error b) 13 c) 13 d) x
10. In _______________ copy, the base address of the objects are copied. In _______________
copy, the base address of the objects are not copied.
11. The nested list undergoes shallow copy even when the list as a whole undergoes deep copy.
State whether this statement is true or false.
a) True b) False
x = ['AB', 'CD']
print(list(map(lower, x)))
def to_upper(k):
return k.upper()
x = ['ab', 'cd']
print(list(map(upper, x)))
14.Program code making use of a given module is called a ______ of the module.
15.______ is a string literal denoted by triple quotes for providing the specifications of certain
program elements.
a) -3.4 b) 3.4 c) 3 d) -3
a) 20 b) 100 c) 4 d) 2.0000000000000004