Advertisement
gruntfutuk

ice-cream

Jun 11th, 2018
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. ice_cream = {'nice':3, 'bad': 4, 'half_way':5}
  2. total=0
  3. while True:
  4.     your_ice = input('\nWhat ice cream would you like: ')
  5.     if your_ice in ice_cream:
  6.         print(f'{your_ice} costs: {ice_cream[your_ice]}kn.')
  7.         total += ice_cream[your_ice]
  8.         print(f'Running total: {total}kn.')
  9.     elif your_ice:
  10.         print(f"Sorry, we don't have {your_ice}.")
  11.     else:
  12.         break
  13. print(f'\n\nThanks. Your total ice cream bill: {total}kn.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement