Advertisement
Gonef

Untitled

Feb 24th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. print('Wprowadź kwotę')
  2. x = 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. y = 0
  5. while x > 0:
  6. if x >= (nominal[y]):
  7. z = int(x / nominal[y])
  8. lista = []
  9. lista.append(str(z) + ' * ' + str(nominal[y]))
  10. x = x % (nominal[y])
  11. y = y + 1
  12. elif x < 0:
  13. print('Chyba popadłeś w długi ;)')
  14. else:
  15. y = y + 1
  16.  
  17. print('Kwotę ' + str(x) + ' można rozmienić na nominały: ' + str(lista))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement