What will be the output of following Python code snippet if x=1?
x<<2
What will be the output of the following Python code?
print('abcdef'.partition('cd'))
What will be the output of the following Python code?
>>> a={1,2,3}
>>> {x*2 for x in a|{4,5}}
Is the following Python code valid?
a={3,4,{7,5}}
print(a[2][0])
What will be the output of the following Python code?
random.seed(3)
random.randint(1,5)
2
random.seed(3)
random.randint(1,5)
What will be the output of the following Python code?
a = ('check',)
n = 2
for i in range(int(n)):
a = (a,)
print(a)
Which of the following rules for naming Python functions is false?
After these statements execute, which of the following describes the values that z and y point to?
>>> z = 5
>>> y = z + 1
>>> z = 10
What will be the output of the following Python code?
class A:
def __str__(self):
return '1'
class B(A):
def __init__(self):
super().__init__()
class C(B):
def __init__(self):
super().__init__()
def main():
obj1 = B()
obj2 = A()
obj3 = C()
print(obj1, obj2, obj3)