Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print('Wprowadź kwotę')
- x = float(input())
- nominal = (500,200,100,50,20,10,5,2,1,0.5,0.2,0.1,0.05,0.02,0.01)
- y = 0
- while x > 0:
- if x >= (nominal[y]):
- z = int(x / nominal[y])
- lista = []
- lista.append(str(z) + ' * ' + str(nominal[y]))
- x = x % (nominal[y])
- y = y + 1
- elif x < 0:
- print('Chyba popadłeś w długi ;)')
- else:
- y = y + 1
- print('Kwotę ' + str(x) + ' można rozmienić na nominały: ' + str(lista))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement