What will be the output?
a = [1, 2, 3] print(a + [4, 5])
[1, 2, 3, 4, 5]
[5, 7, 8]
Error
[4, 5, 1, 2, 3]
t = (5) print(type(t))
<class 'tuple'>
<class 'int'>
<class 'list'>
(10)
[10]
(10,)
{10}
t = (1, 2, 3) t[1] = 5 print(t)
(1, 5, 3)
(1, 2, 3)
None
a, b, c = (10, 20, 30) print(b)
10
20
30
d = {"a": 1, "b": 2} print(2 in d)
True
False
KeyError
a={'a':4,'b':6,'a':7} print(a)
{'a': 5, 'b': 6,'a': 7 }
{'a': 7, 'b': 6}
{'a': 5, 'b': 6 }
Key Error
dict1={'a':[3,6,8]} print(len(dict1))
3
2
1
+
*
-
All of the mentioned
0
-1
What will be the output of the following Python code?
print("xyyzxyzxzxyy".count('yy'))
error
none of the mentioned
print("ccdcddcd".find("c"))
4
seed()
sqrt()
factorial()
print()
(x**y)**z
(x**y) / z
(x**y) % z
(x**y)*z
What will be the output of the following Python expression?
print(round(4.5676,2))
4.5
4.6
4.57
4.56
What will be the output of the following Python function?
import math print(abs(math.sqrt(25)))
-5
5
5.0
sum(2,4,6) sum([1,2,3])
Error, 6
12, Error
12, 6
Error, Error
min(max(False,-3,-4), 2,7)
-3
-4
(a%b, a//b)
(a//b, a%b)
(a//b, a*b)
(a/b, a%b)
enumerate()
all()
chr()
max()