Created
January 16, 2018 23:34
-
-
Save Mdslino/30b3507d4216ff3378c081e49af9e680 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
valor = int(input("Digite o valor: ")) | |
cedulas = [100, 50, 20, 10, 5, 2, 1] | |
notas = {} | |
for cedula in cedulas: | |
if valor >= cedula and valor > 0: | |
notas[cedula] = valor // cedula | |
valor -= notas[cedula] * cedula | |
else: | |
break | |
for key, value in notas.items(): | |
print(f'Notas de {key} = {value}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment