Vidyalelo
Python · Q54

Classes and Objects in Python

Programming · Python · question 54

Q54

What will be the output of the following Python code? class fruits: def __init__(self, price): self.price = price obj=fruits(50) obj.quantity=10 obj.bags=2 print(obj.quantity+len(obj.__dict__))

A.
12
B.
52
C.
13
Answer
D.
60

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board