What will be the output of the following python code?
def printMax(a,b): if a>b: print(a, "is maximum") elif a==b: print(a, "is equal to ",b) else: print(b, "is maximum") printMax(3,4)
3
4
4 is maximum
None of these
What will be the output of the following python program?
def addItem(listParam): listParam+=[1] mylist=[1,2,3,4] addItem(mylist) print(len(mylist))
5
8
2
1
What is the output of below program ?
def say(message, times =1): print(message * times) say("Hello") say("Word",5)
Hello WordWordWordWordWord
Hello Word 5
Hello Word,Word,Word,Word,Word
Hello HelloHelloHelloHelloHello
What is the output of this code?
def calc(x): r=2*x**2 return r print(calc(5))
Error
50
100
20
What is the output of the following code ?
def add(a, b): return a+5, b+5 result = add(3,2) print(result)
15
(8,7)
One
Two
Three
Any Number of Times
What is the return type of following function ?
def func1(): return 'mnp',22 print(type(func1()))
List
Dictionary
String
Tuple
Heap
Stack
Uninitialized data segment
None of the above
What will be the output of the following?
def iq(a,b): if(a==0): return b else: return iq(a-1,a+b) print(iq(3,6))
9
10
11
12
def fun(a, b=6): a=a+b print(a) fun(5, 4)
User Defined Function
Library Functions
Builtin Functions
All of the above
def function function_name():
declare function function_name():
def function_name():
declare function_name():
def disp(*arg): for i in arg: print(i) disp(name="Rajat", age="20")
TypeError
Rajat 20
Name age
What is the output of the following code?
x = 50 def func (x): x = 2 func (x) print ('x is now', x)
x is now 50
x is now 2
x is now 100
What will be the output of the following Python code?
example = "helle" print(example.rfind("e"))
What is the value of the following Python code?
>>>print(36 / 4)
9.0
4.0
What is the output of following Python code?
>>print(5*(2//3))
3.3
0
error
none
What is the output of the following
y='klmn' for i in range(len(y)): print(y)
klmn klmn klmn klmn
k
kkk
None of the these
Segments
Modules
Units
All the above