Python - Custom Exceptions
What will be the output of the following code?
class Book:
pass
b = Book()
b.title = "Python 101"
print(b.title)class Book:
pass
b = Book()
b.title = "Python 101"
print(b.title)Book is empty but Python allows adding attributes dynamically to instances.b is created, then attribute title is added with value "Python 101". Printing b.title outputs the string.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions