Answer the question
In order to leave comments, you need to log in
What is the reason for the error in calling a class function?
Hello everyone, the question arose why, during the execution of the code, when calling a function, the interpreter gives an error 'int' object is not callable. Explain what is wrong and how to fix it
class Automobile:
def __init__(self, num, color, type_auto, health):
self.num = num
self.color = color
self.type_auto = type_auto
self.health = health
def information(self):
print (self.num, self.color, self.type_auto, self.health)
def health(self, unhealth):
self.health -= unhealth
def Auto():
num = int( input('Номeр автомобиля: ' ))
color = input('Цвет автомобиля: ' )
type_auto = input('Тип автомобиля: ')
health = int(input('Состояние автомобиля (%): '))
auto = Automobile(num, color, type_auto, health)
unhealth = int(input())
auto.health(unhealth)
print(auto)
Auto()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question