How to reverse "groups" (not list) of strings? For example I would like to convert "123456789" into "321654987" given that the "group" size equals to 3.
Followings are my code but it turns out to print empty strings:
string = "12345678901234567890"
new_string = ""
for i in range(0, len(string), 5):
new_string = new_string + string[i:i+5:-1]
print (new_string)
Thanks for any input and advice.