Quick actions

cmd+k|ctrl+k

Navigation

Languages

OOP Exercises Python Crash Course

Snippet info

Language

Python

Visibility

public

Author

fuchssohn

Created

2020-04-08T20:06:17Z

Updated

2020-04-08T22:00:39Z

class Restaurant():
    def __init__(self, name, cuisine_type):
        self.restaurant_name = name
        self.cuisine_type = cuisine_type
    
    def describe_restaurant(self):
        print('The restaurant name is '+self.restaurant_name)
        print('The cuisine type is '+self.cuisine_type)
    
    def open_restaurant(self):
        print('The restaurant '+self.restaurant_name+' is open')

a = Restaurant('Slavieiro','Pizzaria')
b = Restaurant('Degraus','Pizzaria')
c = Restaurant('Mix Lanches','Food Truck')
a.describe_restaurant()
b.describe_restaurant()
c.describe_restaurant()
INFO