Ejercicio133
unknown
python
4 years ago
1.4 kB
75
Indexable
# -*- coding: utf-8 -*- """ Created on Tue Oct 12 08:35:28 2021 @author: Quiubs """ #940 cientos = {100:"One Hundred", 200:"Two Hundred", 300:"Three Hundred", 400:"Four Hundred", 500:"Five Hundred", 600:"Six Hundred", 700:"Seven Hundred", 800:"Eight Hundred", 900:"Nine Hundred", } decenas = {20:"Twenty", 30:"Thirty", 40:"Fourty", 50:"Fifty", 60:"Sixty", 70:"Seventy", 80:"Eighty", 90:"Ninety", } unidades = {1:"One", 2:"Two", 3:"Three", 4:"Four", 5:"Five", 6:"Six", 7:"Seven", 8:"Eight", 9:"Nine", 10:"Ten", 11:"Eleven", 12:"Twelve", 13:"Thirteen", 14:"Fourteen", 15:"Fifteen", 16:"Sixteen", 17:"Seventeen", 18:"Eighteen", 19:"NineTeen"} numero = 615 if (numero - (numero % 100)) in cientos: print(cientos[(numero - (numero % 100))]) if ((numero % 100) - (numero % 100) % 10) in decenas: print (decenas[((numero % 100) - (numero % 100) % 10)]) if ((numero % 100) % 10) in unidades: print (unidades[((numero % 100) % 10)])
Editor is loading...