while True print('Hello world')
The pickle module defines ______ exceptions and exports _______ classes.
Is the following Python code valid?
>>> a=(1,2,3)
>>> b=('A','B','C')
>>> c=zip(a,b)
Given a function that does not return any value, What value is thrown by default when executed in shell.
What will be the output of the following Python code snippet?
x = 'abcd'
for i in range(len(x)):
x = 'a'
print(x)
What will be the output of the following Python code?
A = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
[A[i][i] for i in range(len(A))]
What will be the output of the following Python code?
l1=[10, 20, 30]
l2=l1
id(l1)==id(l2)
l2=l1.copy()
id(l1)==id(l2)
In a shallow copy, the modification done on one list affects the other list. In a deep copy, the modification done on one list does not affect the other list.
Why are local variable names beginning with an underscore (e.g., _my_variable) discouraged in Python?