So after some comments, I've changed things around and got another error being TypeError: init() missing 4 required positional arguments: 'body', 'engine', 'brand', and 'model'. I am thinking its in the init code itself however I am new to coding so I am not too sure where it could be if not in the 2nd line of code
class car:
def __init__(self,body,engine,brand,model):
self.body = body
self.engine = engine
self.brand = brand
self.model = model
def paint_cost(self):
if self.body == 'truck':
return 500
if self.body == 'sedan':
return 300
if self.body == 'coupe':
return 150
else:
return 100
def top_speed(self):
if self.body in ['sedan','coupe'] and self.engine == 'bigger':
print('Faster')
else:
print('Slower')
class main(car):
body = input('Enter the body type(truck,coupe,sedan): ')
engine = input('Enter the engine type(bigger or smaller): ')
brand = input('Enter the brand type: ')
model = input('Enter the model: ')
builtcar = car(body,engine,brand,model)
option = input('Enter the option 1. to find paint cost or 2. to find top speed')
if option == '1':
print("Paint cost:",builtcar.paint_cost())
else:
builtcar.top_speed()
main()