pi
anonymous
lambda
none of the above
val
raise
try
with
What will be the output of the following?
print(sum(1,2,3))
error
6
1
3
2
0
none
Execution
Decision
Statement
All of the above
Dictionary
String
Tuple
List
What will be the output of the following Python code
def func(a, b=5, c=10): print('a is', a, 'and b is', b, 'and c is', c) func(13, 17) func(a=2, c=4) func(5,7,9)
(A) a is 13 and b is 15 and c is 10
a is 2 and b is 5 and c is 4
a is 5 and b is 7 and c is 9
(B) a is 13 and b is 17 and cis 10
a is 2 and b is 4 and c is 4
a is 5 and b is 9 and c is 7
(C) a is 13 and b is 17 and c is 10
a is 2 and b is 5 and cis 4
(D) None of the above
option A
option B
option C
option D
What will be the output of the following Python code?
list1=[1,3] list2=list1 list1[0]=4 print(list2)
[1, 4]
[1,3, 4]
[4,3]
[1,3]
What will be output for the following code ?
import numpy as np a=np.array([2,3,4,5]) print(a.dtype)
int32
int
float
none of these
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
len(["hello",2, 4, 6])
Error
4
from math import factorial print(math.factorial(5))
120
Nothing is printed
NameError: name 'math' is not defined
Error, the statement should be print factorial(5))
anywhere in between the file
End
beginning
second line of the file
from package import all
from package import *
from package include all
from package include*
What will be the output of the following code snippet?
numbers = (4, 7, 19, 2, 89, 45, 72, 22) sorted_numbers = sorted(numbers) odd_numbers = [x for x in sorted_numbers if x% 2!=0] print(odd_numbers)
[7, 19, 45, 89]
[2, 4, 22, 72]
[4, 7, 19, 2, 89, 45, 72, 22]
[24, 7, 19, 22, 45, 72, 89]
Integer a, b, c Set b= 5, a = 1 c= a & b Print c
5
7
Choose the correct function declaration of fun1() so that we can execute the following two function calls successfully.
fun1(25, 75, 55) fun1(10, 20)
def fun1(**kwargs)
def fun1(args*)
No, it is not possible in Python
def fun1(*data)
Compiler
Interpreter
Assembler
None of these
x='abcd' for i in x: print(i.upper())
a BCD
abcd
A B CD