Basta Fazoolin' sharing code

I have completed this project and this is my code -
https://github.com/rishitsaraf/Basta-Fazoolin-

please feel free to fork it.

I have completed the project. It took a bit but I got it done. Here is my code,

Caught a typo bug just after posting. In my first business I call new_installation, should be new_installment

Evening All,

Just starting out and learning Python as form of curiosity and skill set. I’m currently enjoying what it can do and how well I’m learning it. I believe I completed the Basta Fazoolin subject accurately if anyone wishes to check my code below. I was struggling abit on the class function but I think I have it down now. I’d like to know if anyone with experience can help me clean it up abit or if there is anything I can do differently to better utilise the language. This is my first language thus far. So experienced eyes would be greatly appreciated. I’ve also commented on the progress or thought process around what I’ve done at each step as well.

class Menu: def __init__(self, name, items, start_time, end_time): self.name = name self.items = items self.start_time = start_time self.end_time = end_time # don't forget to define each argument(make them basic..) def __repr__(self): return "{name} menu available from {start} to {end}".format(name=self.name, start=self.start_time, end=self.end_time) # repr == represent format is nice (learn f/) def calculate_bill(self, purchased_items): purchased_items = [self.items[items] for items in purchased_items] return "The total price of you bill is ${bill}".format(bill=sum(purchased_items)) # list comprehension works, don't forget the self. calls to get information return sum keeps it clean. place a format in their to spruce it up, also allows the calculation. brunch = Menu("brunch", {'pancakes': 7.50, 'waffles': 9.00, 'burger': 11.00, 'home fries': 4.50, 'coffee': 1.50, 'espresso': 3.00, 'tea': 1.00, 'mimosa': 10.50, 'orange juice': 3.50}, 1100, 1600) early_bird = Menu("early_bird", {'salumeria plate': 8.00, 'salad and breadsticks (serves 2, no refills)': 14.00, 'pizza with quattro formaggi': 9.00, 'duck ragu': 17.50, 'mushroom ravioli (vegan)': 13.50, 'coffee': 1.50, 'espresso': 3.00,}, 1500, 1800) dinner = Menu("dinner", {'crostini with eggplant caponata': 13.00, 'ceaser salad': 16.00, 'pizza with quattro formaggi': 11.00, 'duck ragu': 19.50, 'mushroom ravioli (vegan)': 13.50, 'coffee': 2.00, 'espresso': 3.00,}, 1700, 2300) kids = Menu("kids", {'chicken nuggets': 6.50, 'fusilli with wild mushrooms': 12.00, 'apple juice': 3.00}, 1100, 2100) # Insert the class deff first to build the initial structure defined by the class. And to make sure each argument is covered by the required information class Franchise: def __init__(self, address, menus): self.address = address self.menus = menus def __repr__(self): return "Our store location is {location} and they provide {menu}".format(location=self.address, menu=self.menus) def available_menus(self, time): available_menus = [menu for menu in self.menus if time >= menu.start_time and time <= menu.end_time] return available_menus # ava_menus = [] # for menu in self.menus: # if time >= menu.start_time and time <= menu.end_time: # ava_menus.append(menu) # return ava_menus # Don't forget to use the arguments and the definitions set inside the class. Indentation is key here as well. With a bit of fiddling I was able to complete a list comprehension. Any for loop can be done in a list comprehension but for ease of reading for loops are better. Progress has been made. flagship_store = Franchise("1232 West End Road", [brunch, early_bird, dinner, kids]) new_installment = Franchise("12 East Mulberry Street", [brunch, early_bird, dinner, kids]) class Business: def __init__(self, name, franchises): self.name = name self.franchises = franchises business = Business("Basta Fazoolin' with my Heart", [flagship_store, new_installment]) arepas_menu = Menu("Take a' Arepa", {'arepa pabellon': 7.00, 'pernil arepa': 8.50, 'guayanes arepa': 8.00, 'jamon arepa': 7.50}, 1000, 2000) arepas_place = Franchise("189 Fitzgerald Avenue", [arepas_menu]) arepas = Business("Take a Arepa", [arepas_place]) # created a new class, menu, franchise and used business class to define new information. fairl easy and practical once the layout of the other definine classes exsist. # print(flagship_store.available_menus(1200)) # print(flagship_store.available_menus(1700)) # print(flagship_store) # print(new_installment) # print(brunch) # print(early_bird) # print(dinner) # print(kids) # print(brunch.calculate_bill(['pancakes', 'home fries', 'coffee'])) # print(early_bird.calculate_bill(['salumeria plate', 'mushroom ravioli (vegan)'])) # print(arepas_menu) # print(arepas_place) # print(arepas)