Petiasla

4.Change1

Mar 6th, 2022
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. price = float(input())
  2. had_paid = int(input())
  3. had_paid = had_paid * 100
  4. price = int(price*100)
  5.  
  6. change = had_paid - price
  7. count = 0
  8.  
  9. if change >= 100:
  10. print(change/100 , " x 1 lev")
  11. change %=100
  12. elif change >= 50 :
  13. print(change/50 , "x 50 stotinki")
  14. change %= 50
  15. elif change >= 20:
  16. print(change / 20, "x 20 stotinki")
  17. change %= 20
  18. elif change >= 10:
  19. print(change / 10, "x 10 stotinki")
  20. change %= 10
  21. elif change >= 5:
  22. print(change / 5, "x 5 stotinki")
  23. change %= 5
  24. elif change >= 2:
  25. print(change / 2, "x 2 stotinki")
  26. change %= 2
  27. elif change >= 1:
  28. print(change / 1, "x 1 stotinki")
  29. change %= 1
  30.  
Advertisement
Add Comment
Please, Sign In to add comment