so like i’m trying to import a module in Python and I did the exact same thing the guy on Youtube did but mine is still not working…..im have two different files "oop.py" and "car.py".
i am trying to import from "car.py" to "oop.py"
class Car:
def __int__(self,make,model,year,color):
self.make = make
self.model = model
self.year = year
self.color = color
def drive(self):
print("this car is driving")
def stop(self):
print("This car has stopped")
the above is "car.py"
from car import Car
car_1 = Car("chevy","standard",2021,"blue")
the above is "oop.py"
Traceback (most recent call last):
File "C:\Users\ike\PycharmProjects\main\object oriented programming\oop.py", line 3, in
car_1 = Car("chevy","standard",2021,"blue")
TypeError: Car() takes no arguments
Process finished with exit code 1
this is the error i keep getting.
pls what is the problem
>Solution :
To begin with, __int__ should be __init__.