Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def censor(text, word):
  2.     result = ""
  3.     text = text.split()
  4.     for c in text:
  5.         if c == word:
  6.             c = "*" * len(word)    
  7.         result = result + ' ' + c
  8.     return result
  9.    
  10.  
  11. print censor("hey hey hey", "hey")
  12.  
  13.  
  14. Oops, tente outra vez. Sua funcao falha em censor("hey hey hey","hey"). Ela retorna " *** *** ***" quando deveria retornar "*** *** ***".
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement