What will be the output of the following Python expression?
x=24//6%3, 24//4//2 print(x)
(1,3)
(0,3)
(1,0)
(3,1)
What will be the output of the following Python code?
print('{a}{b}{a}'.format(a='hello', b='world'))
‘hello world’
‘hello’ ‘world’ ‘hello’
‘helloworldhello’
‘hello’ ‘hello’ ‘world’
d = {0, 1, 2} for x in d: print(d.add(x))
0 1 2
0 1 2 0 1 2 0 1 2 …
None None None
None of the mentioned
What will be the output of the following Python code snippet?
print('a@ 1,'.islower())
True
False
None
Error
print('Hello!2@#World'.istitle())
error
print('abcd'.partition('cd'))
(‘ab’, ‘cd’, ”)
(‘ab’, ‘cd’)
none of the mentioned
print('abef'.replace('cd', '12'))
abef
12
list1 = list()
list1 = []
list1 = list([1, 2, 3])
all of the mentioned
[‘h’, ‘e’, ‘l’, ‘l’, ‘o’]
[‘hello’]
[‘llo’]
[‘olleh’]
5
4
2445
133
12454
123
3
25
1
9
15
list1.shuffle()
shuffle(list1)
random.shuffle(list1)
random.shuffleList(list1)
print(list1[0])
print(list1[:2])
print(list1[:-2])
2
What is the output of the following code?
list1=[2, 33, 222, 14, 25] print(list1[ : -1 ])
[2, 33, 222, 14]
[25, 14, 222, 33, 2]
names = ['Amir', 'Bear', 'Charlton', 'Daman'] print(names[-1][-1])
A
Daman
n
[2, 6, 4]
[1, 3, 2, 1, 3]
[1, 3, 2, 1, 3, 2]
[1, 3, 2, 3, 2, 1]
[0, 1, 2, 3]
[0, 1, 2, 3, 4]
[0.0, 0.5, 1.0, 1.5]
[0.0, 0.5, 1.0, 1.5, 2.0]