Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pyperclip
- def roach(words):
- string_new = ''
- new_sentence = []
- for section in words:
- if 'brother' in section.lower() or section.isdigit():
- new_sentence.append(section)
- continue
- added = False
- for char in special_char:
- if char in section:
- new_sentence.append(section[:section.index(char)] + 'roach' + char)
- added = True
- break
- if not added:
- new_sentence.append(section + 'roach')
- continue
- for word in new_sentence:
- string_new += word + ' '
- pyperclip.copy(string_new)
- print('')
- if __name__ == '__main__':
- while True:
- string = input("What should I convert into Roachanese ? (Enter 'stopbrother' to exit): ")
- if string.lower() == 'stopbrother':
- break
- special_char = ['.', ',', ';', ':', '-', '_', '\'', '\"', '?', '!', '$', '%', '&', '*', '(', ')', '/', '\\']
- sections = string.split(' ')
- roach(sections)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement