Advertisement
OverSkillers

ComparaLetras(teste2)

Nov 20th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. def compara_letras(palavra1,palavra2):
  2.     lista1 = []
  3.     lista2 = []
  4.     lista1 = "".join(sorted(palavra1))
  5.     lista2 = "".join(sorted(palavra2))
  6.    
  7.     for i in range(len(lista1)):
  8.         if lista1[i] == lista2[i]:
  9.             check = 1
  10.         else:
  11.             check = 0
  12.             break
  13.        
  14.     if check == 1:
  15.         print("iguais")
  16.     else:
  17.         print("diferentes")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement