...
 
Commits (22)
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/course.iml" filepath="$PROJECT_DIR$/.idea/course.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
class Bookshelf:
def __init__(self, books):
self.books=books
......@@ -21,6 +20,8 @@ class Book:
#book1=Book("title1", "author1")
#print(book1)
book_shelf=Bookshelf(books=[('The old man and the see', 'Ernest Hemingway'),
('Beyond Good and Evil', 'Friedrich Nietzsche'),])
#print(book_shelf)
class Dish:
def __init__(self,name, price, ingredients):
self.name=name
......@@ -32,14 +31,11 @@ class Restaurant:
return f" Customer {client} \n Order # {self.order.index(order)} : {order[1]} - {order[1].price}"
def print_check(self,client):
total=0
# this code is just to assure the customer name will be printed only once
#if len(list(zip(*self.order))[0]) > 0: #zip retrieves the first element accross a lists and returns a list with them
# print(f" Customer {client} \n ")
#end
#OR just print out the line bc I am passing it as a parameter:
print(f" Customer {client} \n ")
for order in self.order:
if order[0] == client:
total += order[1].price
......