Guest User

Untitled

a guest
Jun 18th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1.  
  2. from string import swapcase
  3.  
  4. def zvezdice(str):
  5. out = ''
  6. change = False
  7.  
  8. for char in str:
  9. if char == '*':
  10. change = not change
  11.  
  12. if change:
  13. out += swapcase(char)
  14. else:
  15. out += char
  16.  
  17. return out
  18.  
  19. print zvezdice('thiS is *sHiBlabal* should this *WoRk')
Add Comment
Please, Sign In to add comment