Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Felipe’s_Taqueria.py #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 41 additions & 32 deletions ProblemSet_3/Felipe’s_Taqueria.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,49 @@
# // Assignment: Felipe's Taqueria //
# // //
# ////////////////////////////////////////
def main():
is_available()

# // Store the menu items and the cost as values
MENU: dict[str, float] = {
"baja taco": 4.00,
"burrito": 7.50,
"bowl": 8.50,
"nachos": 11.00,
"quesadilla": 8.50,
"super burrito": 8.50,
"super quesadilla": 9.50,
"taco": 3.00,
"tortilla salad": 8.00
}
def is_availabe():
MENU= {
"baja taco": 4.00,
"burrito": 7.50,
"bowl": 8.50,
"nachos": 11.00,
"quesadilla": 8.50,
"super burrito": 8.50,
"super quesadilla": 9.50,
"taco": 3.00,
"tortilla salad": 8.00
}

# // Store the total cost
total: int = 0
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//use total=0


while 1:
try:
# // Get the item
item= input("Item: ").lower()

# // Increase the total by the value
# // from the item in the MENU map
if item in MENU:
total += MENU[item]

# // Print the new total formatted to 2 decimal points
print(f"Total: ${total:.2f}")
elif item=='burger':
is_available()
else:
exit()


# // Except Control+D is pressed
except EOFError:
break

# // Store the total cost
total: int = 0

while 1:
try:
# // Get the item
item: str = input("Item: ").lower()

# // Increase the total by the value
# // from the item in the MENU map
if item in MENU:
total += MENU[item]

# // Print the new total formatted to 2 decimal points
print(f"Total: ${total:.2f}")

# // Except Control+D is pressed
except EOFError:
break
main()

# https://github.com/settings/tokens
# check50 cs50/problems/2022/python/taqueria
# submit50 cs50/problems/2022/python/taqueria
# submit50 cs50/problems/2022/python/taqueria