Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def scientist(keyword, to_reverse=False):
- global writing
- for index, word in enumerate(writing):
- if sorted([word, keyword])[0] == keyword:
- writing[index] = word[::2][::-1] if to_reverse else word[::2]
- else:
- writing[index] = word[::3][::-1] if to_reverse else word[::3]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement