What type of error is returned by following statement? print(int(“a”))
1.Syntax error
2.ValueError
3.TypeError
4.Name Error
Posted Date:-2021-12-12 04:07:08
Which of the following module is used for function max( )??
1.math
2.csv
3.random
4. No module is required
Posted Date:-2021-12-12 04:28:45
Write the output of the following :
def var(var, lst):
lst[0] = var
k = 33
a = [1, 2, 3]
var(k, a)
print(a)1.1, 2, 3]
2.[33, 1, 2, 3]
3. [33, 1, 2]
4.Error
Posted Date:-2021-12-12 04:27:20
Write the output of the following : t=(32, 34, 33, 33.5, 41, 44, 33) print(sum(t) + t.count(33))
1.252.0
2.253.0
3.252.5
4.254
Posted Date:-2021-12-12 04:29:29
Write the output of the following:
def lst(l1):
for x in l1:
print(x.lower(),end="---")
lst(["MCQ","PAPER"])1.MCQ—PAPER—
2.mcq—paper—
3.—mcq—paper
4.None of the above
Posted Date:-2021-12-12 04:30:37
Write the output of the following. print(abs(-8))
1.-8
2.8
3. 8.0
4.None of the above
Posted Date:-2021-12-12 04:10:35
How many numbers will be printed by the following code:
def fun(n1,n2):
for x in range(n1,n2+1):
if x%4==0:
print(x, end=" ")
fun(100,120)1.5
2.6
3.7
4.8
Posted Date:-2021-12-12 04:29:54
Name the function required to check if a string contains only uppercase letters?
1.upper( )
2. isup( )
3.isupper( )
4.iscapital( )
Posted Date:-2021-12-12 04:19:58
Which method of pickle module reads data from a binary file?
1.dump( )
2. load( )
3.read( )
4.reader( )
Posted Date:-2021-12-12 04:22:22
Which of the following function is not invoked by math module?
1.ceil( )
2.floor( )
3.sqrt( )
4.mean( )
Posted Date:-2021-12-12 04:21:33
Which of the following function returns the length of a sequence?
1.len( )
2.length( )
3. lenseq( )
4.None of the above
Posted Date:-2021-12-12 04:20:48
Which of the following mathematical function return absolute value of a number?
1.absolute( )
2.abs( )
3.perfect( )
4. absl( )
Posted Date:-2021-12-12 04:14:20
Which of the following mathematical function return factorial of a number?
1.fact( )
2.facto( )
3.factorial( )
4.fct( )
Posted Date:-2021-12-12 04:19:05
Which of the following module is used with binary files?
1.math
2.csv
3.random
4.pickle
Posted Date:-2021-12-12 04:28:02
Which of the following module which need to be imported to invoke randint( ) function?
1.randoms
2.random
3.random( )
4.None of the above
Posted Date:-2021-12-12 04:17:51
Which of the following Python module need to be imported to invoke sin( ) function?
1.math
2.Maths
3.mathematics
4.None of the above
Posted Date:-2021-12-12 04:16:25
Write the output of : print((range(5)))
1.range(0, 5)
2.0, 1, 2, 3, 4
3.[0, 1, 2, 3, 4]
4.Error
Posted Date:-2021-12-12 04:13:17
Write the output of : print(float())
1. 1.0
2.0.0
3.Any floating number
4.Any integer
Posted Date:-2021-12-12 04:02:58
Write the output of : print(sum(1,2,1))
1.Error
2.4
3.2
4.3
Posted Date:-2021-12-12 04:24:23
Write the output of the following : print(round(34.5671,2)) print(round(34.3631,2))
1.34.57 34.36
2.34.56 34.37
3.34.57 35.36
4.36.00 34.36
Posted Date:-2021-12-12 04:11:38
Write the output of the following:
def c(x, y):
if x % y :
return x+5
else:
return y+10
print(c(20, 5))1.26
2.15
3.30
4.10
Posted Date:-2021-12-12 04:22:55
Write the output of the following:
def calc(x):
r=2*x**2
return r
print(calc(3))1.18
2.8
3.36
4.9
Posted Date:-2021-12-12 04:26:41
Write the output of the following:
def disp(m="A", t = 1):
for i in range(t):
print(m * 1, end="#")
disp('B', 5)1.B#B#B#B#B#
2.BBBBB
3.BBBBB#
4.#BBBBB#
Posted Date:-2021-12-12 04:25:48
Write the output of the following:
def guess(n="k", a=20, r="t"):
return a, n, r
t=guess("k", "t", 7)
print(t)1.(‘k’, ‘t’, 7)
2.(‘t’, ‘k’, 7)
3.(7, ‘t’, ‘k’)
4.(‘t’, 7, ‘k’)
Posted Date:-2021-12-12 04:23:44
Write the output of the following: print(list(i * 2 for i in range(4))) print(list(range(4)))
1.[0, 2, 4, 6] [3]
2.[0, 2, 4, 6] [0, 1, 2, 3]
3.[0, 1, 2, 3] [0, 1, 2, 3]
4.None of the above
Posted Date:-2021-12-12 04:12:31
Write the output of the following: print(max(2, 5, 4, 8, 29, 24))
1. Error as there should be math.max( )
2.29
3.2
4.2 5 4 8 29 24
Posted Date:-2021-12-12 04:09:09
Write the output of the following: print(min(“Hell”, “Hello”, “he”))
1.Hell
2.he
3.Hello
4.Error
Posted Date:-2021-12-12 04:09:52
Write the output of the following:
val = 20
def display (N):
val = 25
if N%5 == 0:
val = val + N
else:
val = val - N
print(val, end="#")
display(70)
print(val)1.70#20
2.95#20
3.75#20
4.50#20
Posted Date:-2021-12-12 04:25:01
Write the output of the following: if user entered 7
a=input("Enter age")
print(type(a))1.str
2.int
3.float
4.None of the above
Posted Date:-2021-12-12 04:07:48