maynul67

expenditure calculator

Jul 24th, 2021
1,035
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print("Expenditure calculator \n_____________________________\nEnter q to quit and show result\n")
  2. sum = 0
  3. dict = {}
  4. while True:
  5.     n = input("Enter item :")
  6.     if n == "q":
  7.         break
  8.     p = float(input("enter price :"))
  9.     sum = sum + p
  10.     dict[n] = p
  11.    
  12. print(dict)
  13. print(sum)
RAW Paste Data