Gonef

Untitled

Feb 24th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. print('Wprowadź kwotę')
  2. kwota = float(input())
  3. nominal = (500,200,100,50,20,10,5,2,1,0.5,0.2,0.1,0.05,0.02,0.01)
  4. x = kwota
  5. y = 0
  6. lista = []
  7. while kwota > 0:
  8. if kwota >= (nominal[y]):
  9. z = int(kwota / nominal[y])
  10. lista.append(str(z) + ' * ' + str(nominal[y]))
  11. kwota = kwota % (nominal[y])
  12. y = y + 1
  13. elif kwota < 0:
  14. print('Chyba popadłeś w długi ;)')
  15. else:
  16. y = y + 1
  17.  
  18. print('Kwotę ' + str(x) + ' można rozmienić na nominały: ' + str(lista))
Advertisement
Add Comment
Please, Sign In to add comment