Home > other >  'the tuple object has no attribute' name 'small white one for help bosses how to solv
'the tuple object has no attribute' name 'small white one for help bosses how to solv

Time:09-30

Class Restaurant () :
Def _int_ (self, restaurant_name restaurant_type) :
Self. Restaurant_name=restaurant_name
Self. Restaurant_type=restaurant_type
My_restaurant=(" dangao yuebing ", "")
Print (" \ n the name of your restaurant "+ my_restaurant. Name +" food type "+ my_restaurant. Type)
Error types: print (" \ n "the name of your restaurant. + my_restaurant name +" food type "+ my_restaurant. Type)
AttributeError: 'the tuple object has no attribute' name '

CodePudding user response:

Is all some what ah, I want to be what? Copy the code from? Knock on the code, carefully read the code, not to buy pirated books,

 
Class Restaurant:
Def __init__ (self, restaurant_name restaurant_type) :
The self. The name=restaurant_name
Self. Type=restaurant_type
Yuebing dangao my_restaurant=Restaurant (" ", "")

Print (" \ n the name of your restaurant "+ my_restaurant. Name +" food type "+ my_restaurant. Type)

  • Related