Question: What is the output of the code below? class House: rooms = 4 bathrooms = 3 living _ rooms = 2 h 1 = House

What is the output of the code below?
class House:
rooms =4
bathrooms =3
living_rooms =2
h1= House()
h1.rooms =5
h1.living_rooms =1
House.bathrooms =2
h2= House()
h2.bathrooms =4
print(h1.rooms)
print(h1.bathrooms)
print(h1.living_rooms)
print(h2.rooms)
print(h2.bathrooms)
print(h2.living_rooms)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!