Advertisement
WupEly

Untitled

Dec 20th, 2022
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 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. writing[index] = word[::2][::-1] if to_reverse else word[::2]
  7. else:
  8. writing[index] = word[::3][::-1] if to_reverse else word[::3]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement