fork download
  1. # coding=utf8
  2. d_liscod = {} #dicionário gigante omitido
  3. import getpass
  4. import re
  5. d_texdr = input('Insira o texto: ')
  6. print()
  7. d_texdecr = ''
  8. d_de_crcod = [{v: k for k, v in i.items()} for i in d_liscod]
  9. d_lisel = re.split(r'(\S+)', d_texdr) #cria lista com cada elemento tipográfico de d_texdr
  10. if d_lisel[0] == ('') or d_lisel[0] == (' ') or d_lisel[0] == (' '):
  11. del d_lisel[0]
  12. if d_lisel[-1] == ('') or d_lisel[0] == (' ') or d_lisel[0] == (' '):
  13. del d_lisel[-1]
  14. for i in d_lisel:
  15. for u in i:
  16. try:
  17. if u in d_de_crcod[d_lisel.index(i)]:
  18. d_talt += d_de_crcod[d_lisel.index(i)][u]
  19. except:
  20. pass
  21. try:
  22. if u not in d_de_crcod[d_lisel.index(i)]:
  23. d_talt += u
  24. except:
  25. pass
  26. print('O texto alterado é:', d_talt)
  27. print()
  28. input()# your code goes here
Runtime error #stdin #stdout #stderr 0.04s 9536KB
stdin
Standard input is empty
stdout
Insira o texto: 
stderr
Traceback (most recent call last):
  File "./prog.py", line 5, in <module>
EOFError: EOF when reading a line