Advertisement
davide1409

No occorrenza

Nov 15th, 2019
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. def No_occorrenza(s):
  2. #@param s: string
  3. #@return string
  4.  
  5.   new_str = ''
  6.  
  7.   for ch in s:
  8.     if ch in new_str and ch != ' ':
  9.       new_str+='*'
  10.      
  11.     else:
  12.       new_str+=ch
  13.      
  14.      
  15.   return new_str
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement