Advertisement
maynul67

expenditure calculator

Jul 24th, 2021
1,164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement