Advertisement
PedroPauloFO

pppdnio3uo

Jun 12th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.01 KB | None | 0 0
  1. # coding: utf-8
  2. # Programação 1, 2014.1 Pedro Paulo
  3. # inverte Consoantes Coincidentes
  4.  
  5. palavra1 = raw_input()
  6. palavra2 = raw_input()
  7.  
  8. tamanho_max = len(palavra1)
  9. if len(palavra2 > len(palavra1):
  10.     tamanho_max = len(palavra2)
  11. aspas = '"'
  12.  
  13. print "Consoantes coincidentes"
  14.  
  15. for i in range (tamanho_max):
  16.     if palavra1[i] == palavra2[i] and palavra1[i] != a and palavra1[i] != e and palavra1[i] != i and palavra1[i] != o and palavra1[i] != u:
  17.         posicao = i + 1
  18.         print aspas + "%s" % palavra1[i] + aspas  + "na posição %d" % posicao
  19.  
  20. print "Inverso das consoantes coincidentes"
  21.  
  22. indice_reverso = tamanho_max - 1
  23. for i in range (tamanho_max):
  24.  
  25.     if palavra1[indice_reverso] == palavra2[indice_reverso] and palavra1[indice_reverso] != a and palavra1[indice_reverso] != e and palavra1[indice_reverso] != i and palavra1[indice_reverso] != o and palavra1[indice_reverso] != u:
  26.     saida = saida + palavra1[indice_reverso]
  27.     print "Inverso das consoantes coincidentes" + aspas + saida + aspas
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement