Answers for "Class creating for House Class instanses"

0

Class creating for House Class instanses

class House(object):
   def __init__(self, size, color):
         self.color = color
         self.size = size

bluehouse = House(4, "blue")
redhouse = House(2, "red")
print bluehouse.color #Prints 'blue'
print redhouse.color # Prints 'red'
Posted by: Guest on January-08-2022

Browse Popular Code Answers by Language