What does the following code prints:
>>> all([i<5 for i in range(5)])
Write the output of the following code:
list=[1,2,-1,3,4,5,6]
y=list[list[2]]
print(y)
What will be the output of the following Python code?
x = 'abcd'
for i in x:
print(i.upper())
Find the output of the following code:
l=['a',14,4,"b","&",":",5]
del l[5]
print(l)
What will be the output of the following Python code?
def foo(fname, val):
print(fname(val))
foo(max, [1, 2, 3])
foo(min, [1, 2, 3])
What will be the output of the following Python code?
import random
random.choice(2,3,4)
What will be the output of the following code?
s={'name':'nancy','age':20,'year':2000}
q=s['year']
v=s['age']
p=q
e=v
print(q)
print(p)
What will be the output of the following Python code?
x = ['ab', 'cd']
for i in x:
x.append(i.upper())
print(x)
What will be the output of the following Python code snippet?
>>>import collections
>>> b=collections.Counter([2,2,3,4,4,4])
>>> b.most_common(1)
What does built-in function type do in context of classes?