How would I be able to take a string like \'aaaaaaaaaaaaaaaaaaaaaaa\'
and split it into 4 length tuples like (aaaa,aaaa,aaaa
I think this method is simpler. But the message length must be split with split_size. Or letters must be added to the message. Example: message = "lorem ipsum_" then the added letter can be deleted.
message = "lorem ipsum"
array = []
temp = ""
split_size = 3
for i in range(1, len(message) + 1):
temp += message[i - 1]
if i % split_size == 0:
array.append(temp)
temp = ""
print(array)
Output: ['lor', 'em ', 'ips']