I'm using Python to program for the lab I work at. How can I slice out every 3 characters in a given string and append it to a list?
i.e. XXXxxxXXXxxxXXXxxxXXXxxxXXX (where X or x is any given letter)
string = 'XXXxxxXXXxxxXXXxxxXXXxxxXXX'
mylist = []
for x in string:
string[?:?:?]
mylist.append(string)
I want the list to look like this: ['XXX','xxx','XXX','xxx','XXX'....etc]
Any ideas?