Subroutines
Files
Pseudo code
Modules
Function
Definition
Parameters
Arguments
int
bool
void
None
How many numbers will be printed by the following code?
def fun(a,b): for x in range(a,b+1): if x%3==0: print(x,end=" ") fun(100,120)
7
8
6
9
What is the output of below program ?
def maximum(x,y): if x>y: return x elif x==y: return "The number are equal" else: return y print(maximum(2,3))
2
3
The number are equal
None of These
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)
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
1
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))
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():