Dictionary Iteration: What will the output be of the following code?
Code
D = {1:['Raj', 22], 2:['Simran', 21], 3:['Rahul', 40]}
for val in D:
print(val)
Code
D = {1:['Raj', 22], 2:['Simran', 21], 3:['Rahul', 40]}
for val in D:
print(val)
Code
l = [32, 34, 12, 27, 33]
l.append([14, 19])
print(len(l))
Code
L1 = ['Vikas', 'Akshay', 'Sanskar', 'Mahima']
print(L1[1][-1])
Code
class A:
def __init__(self, x=1):
self.x = x
class B(A):
def __init__(self,y =2):
super().__init__()
self.y = y
def main():
b = B()
print(b.x,b.y)
main()
Code
class A :
x = 10
def __init__(self, y,z):
self.y = y
self.z = z
def update_y(self):
self.y = self.y * self.z
A1 = A(3,4)
A2 = A(5,6)
A.x = 30
A1.y + A2.x