79104190

Date: 2024-10-19 04:18:00
Score: 0.5
Natty:
Report link

The answer to this very straightforward.

class Restaurant:
    def __init__ (self, restaurant_name, cuisine_type):
        self.name = restaurant_name
        self.type = cuisine_type
        
    def describe_restaurant(self):
        print(f"This restaurant's name is: '{self.name.title()}' and serves {self.type}")
        
    def restaurant_open(self):
        print(f"'{self.name.title()}' is currently open")

res1 = Restaurant('pho hung', 'vietnamese pho')
res1.describe_restaurant()

res2 = Restaurant('macdonalds', 'american fast')
res2.describe_restaurant()
res2.restaurant_open()

Output would be:

This restaurant's name is: 'Pho Hung' and serves vietnamese pho
This restaurant's name is: 'Macdonalds' and serves american fast
'Macdonalds' is currently open

Reference:

  1. https://docs.python.org/3/library/stdtypes.html#str.title
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Hariharan Ragothaman