Advertisement
WupEly

Untitled

Dec 20th, 2022
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. def scientist(keyword, to_reverse=False):
  2. global writing
  3.  
  4. for index, word in enumerate(writing):
  5. if sorted([word, keyword])[0] == keyword:
  6. if to_reverse:
  7. writing[index] = word[::2][::-1]
  8. else:
  9. writing[index] = word[::2]
  10. else:
  11. if to_reverse:
  12. writing[index] = word[::3][::-1]
  13. else:
  14. writing[index] = word[::3]
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement