Advertisement
clesiomatias

função maiúsculas

Sep 9th, 2020
1,092
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. def maiuscula(texto):
  2.     up ={"a":"A","b":"B",'c':"C",'d':"D",'e':"E","f":"F",'g':"G",'h':"H",'i':"I",'j':"J",'k':"K",'l':"L",'m':"M",'n':"N",'o':"O",'p':"P",'q':"Q",'r':"R",'s':"S",'t':"T",'u':"U",'v':"V",'w':"W",'x':"X",'y':"Y",'z':"Z"}
  3.     letras=[]
  4.     junto=''
  5.     for i in texto:
  6.         if i.isalpha():
  7.             letras.append(up[i])
  8.         else:
  9.             letras.append(i)
  10.     return junto.join(letras)
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement