O Trabalho Pratico
Por: Morgana Louise • 20/4/2022 • Trabalho acadêmico • 503 Palavras (3 Páginas) • 137 Visualizações
Trabalho Pratico-Morgana Louise de Souza
def centena (c,d,u):
if c==9:
print('novecentos ',end='')
elif c==8:
print('oitocentos ',end='')
elif c==7:
print('setecentos ',end='')
elif c==6:
print('seiscentos ',end='')
elif c==5:
print('quinhentos ',end='')
elif c==4:
print('quatrocentos ',end='')
elif c==3:
print('trezentos ',end='')
elif c==2:
print('duzentos ',end='')
elif c==1:
if u==0 and d==0:
print('cem ',end='')
else:
print('cento ',end='')
def dezena (d,u):
if d==9:
print('noventa ',end='')
elif d==8:
print('oitenta ',end='')
elif d==7:
print('setenta ',end='')
elif d==6:
print('sessenta ',end='')
elif d==5:
print('cinquenta ',end='')
elif d==4:
print('quarenta ',end='')
elif d==3:
print('trinta ',end='')
elif d==2:
print('vinte ',end='')
elif d==1:
if u==1:
print('onze ',end='')
elif u==2:
print('doze ',end='')
elif u==3:
print('treze ',end='')
elif u==4:
print('quatorze ',end='')
elif u==5:
print('quinze ',end='')
elif u==6:
print('dezesseis ',end='')
elif u==7:
print('dezessete ',end='')
elif u==8:
print('dezoito ',end='')
elif u==9:
print('dezenove ',end='')
elif u==0:
print('dez ',end=' ')
def unidade (d,u):
if d!=1:
if u==1:
print('um ',end='')
elif u==2:
print('dois ',end='')
elif u==3:
print('três ',end='')
elif u==4:
print('quatro ',end='')
elif u==5:
print('cinco ',end='')
elif u==6:
print('seis ',end='')
elif u==7:
print('sete ',end='')
elif u==8:
print('oito ',end='')
elif u==9:
print('nove ',end='')
def milhar(c,d,u):
centena(c,d,u)
if c==0 and d==0:
print('',end='')
else:
print('e ',end=' ')
dezena(d,u)
if d==0:
print('',end='')
else:
print('e ',end=' ')
unidade(d,u)
n=int(input('digite o número: '))
cB=n//100000000000
n=n%100000000000
dB=n//10000000000
n=n%10000000000
uB=n//1000000000
n=n%1000000000
milhar(cB,dB,uB)
if uB>1 and dB==0 and cB==0:
...