Advertisement
andreaQuirici

problema 3 e 4

Nov 18th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. def sub(str):
  2. #@ param str: string
  3.   str0=''
  4.   for ch in str:
  5.     if ch in str0 and ch !=' ':
  6.       str0=str0+'*'
  7.     else:
  8.       str0=str0+ch
  9.   return str0
  10.  
  11.  
  12. def palindroma(str):
  13. #@ param str: string
  14.   i=0
  15.   while i<=(len(str)/2):
  16.     if not str[i]==str[(len(str)-1)-i]:
  17.       return False
  18.     i=i+1
  19.   return True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement