Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 325 Bytes

File metadata and controls

23 lines (17 loc) · 325 Bytes

Print Order

Objectives

  1. What would be the output of the following code?
print(1)
class Car:
    print(2)
    def __init__(self, color):
        print(3)
        self.color = color
    print(4)
print(5)

car1 = Car("red")
car2 = Car("green")

Solution

Click here to view the solution