I'm doing a program for a class of mine and I am having trouble splitting my strings up. I know you can do something like:
a = '012345'
a[0:3] returns 012
but I am inputing strings of varying length and I cant just do the above notation. I need to split the string into groups of 3 in order to work. Any help would be much appreciated.
You can use that notation, you just need to use a loop and probably the range function (docs here in the Python Library Reference). Or you could use the slice function from the same source.