Menu

[solved]-Class Rest Def Int Self Name Ctype Selfname Name Selfctype Ctype Def Describerestaurant Pr Q39033743

class rest(): def __int__(self, name, ctype): self.name = name self.ctype = ctype def describerestaurant(): print(“The name of the restaurant is ” + str(self.name) + “and the my type is of cuisine type is ” + str(self.ctype)) def openrestaurant(): print(“The restaurant is open”)new = rest(‘willie’, ‘coco’)#print(rest.describerestaurant())

the error is

Traceback (most recent call last):
File “C:/Users/Josue/PycharmProjects/Project1/restaurant2.py”, line13, in <module>
new = rest(‘willie’, ‘coco’)
TypeError: rest() takes no arguments

Process finished with exit code 1

Expert Answer


Answer to class rest(): def __int__(self, name, ctype): self.name = name self.ctype = ctype def describerestaurant(): print(“The … . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *