JetBrains / JetBrains/guide

Pychamer

Open
#27 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
42
Forks
45
PR merge metrics
No merged PRs in 30d

Description

def calculate_tax(price):
tax_rate = 0.10 # 10%tax
return price * (1 + tax_rate / 100)

def menu():
total = 0.0
selection = 0

while selection != 6:
print("\n--- MENU ---\n")
print("1. Burger - $5.00")
print("2. Cookies - $4.58")
print("3. Coffer - $3.68")
print("4. water - $1.99")
print("5. Chocolate - $6.13")
print("6. Exit ")

try:
selection = int(input("Enter your selection (1-6): "))
except ValueError:
print("Invalid input. Please enter a number between 1 and 6.")
print("Continuing...")

if selection == 1:
total += 5.00
elif selection == 2:
total += 4.58
elif selection == 3:
total += 3.68
elif selection == 4:
total += 1.99
elif selection == 5:
total += 6.13
elif selection == 6:
print("Exiting menu...")
break
else:
print("Invalid input. Please choose a valid option.")

print(f"Current total: ${total:.2f}")

print('return total')
why error

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.