Q34
What will be the output of the following Python code? class stud: def __init__(self, roll_no, grade): self.roll_no = roll_no self.grade = grade def display (self): print("Roll no : ", self.roll_no, ", Grade: ", self.grade) stud1 = stud(34, 'S') stud1.age=7 print(hasattr(stud1, 'age'))
A.
Error as age isn't defined
B.
True
AnswerC.
False
D.
7
Answer: Option B
Solution
Answer: Option B
No explanation is given for this question Let's Discuss on Board