title: Python cashier without db
body: <p>so i have this mission to build a python cashier program using only python. without db use.
  i use the dict and keys method to build it.
  so i have 2 questions:</p>
  <ol>
  <li>can i get an idea how to keep the program running after the moneybalance part, while i'm still saving the current moneybalance status? like, to make it an continuous program and not just one time.</li>
  <li>i would like to get overall review on how is the idea for this mission, how it's written, and etc. would you do it in other way? if so i would like to hear how.
  remember, my mission is to build python cashier without any outside libraries\db's.</li>
  </ol>
  <p>Code:</p>
  <pre><code>print('welcome to python cashier')
  money = int(input('enter cashier current money\n'))
  
  
  prices = {&quot;small popcorn&quot; : 3, &quot;medium popcorn&quot; : 5,
               &quot;large popcorn&quot; : 8, &quot;small drink&quot; : 1,
                &quot;medium drink&quot; : 2, &quot;large drink&quot; : 3 }
   
  
  def calc(money, prices):
        try:
           itemchange = pay - itemvalue  
        except Exception as e:
          print(e)
        finally:
          print(f'change: {itemchange}') 
  
  def show(money, prices): 
       try:
           for key,value in prices.items():
              print (f'{key}: {value}')
       except Exception as e:
           print(e)
       finally:
           return False
  show(money, prices)
  
  def start(money, prices):
       try:
       
          for key, value in prices.items():
            global item
            item = str(input('enter what you want to buy:\n'))
            if (item in prices.keys()):
              global itemvalue
              itemvalue = prices.get(item)
              print(f'{item}: {itemvalue}')
              global pay
              pay = float(input('how much costumer pay?\n'))
              return calc(money, prices)
            else:
              print('item not found')
       except Exception as e:
             print(e)
       finally:
             moneybalance = money + itemvalue
             print(f'moneybalance: {moneybalance}')
                
  
  start(money, prices)
  </code></pre>