I'm just trying to understand how to make a value after value x (i.e. x+1) in a string be included in a split.
I've tried a for loop, of just for i: splitlist.append(i)
and can end up printing [A, B, C, D, E].
samplestring = 'ABCDE'
for i in samplestring:
splitlist = []
if i+1 == (none):
break
else:
splitlist.append(i,i+1)
I want to return ['AB', 'BC', 'CD', 'DE'] but instead end up with a type error in the line ;
if i+1 == (none):
.
(TypeError: can only concatenate str (not "int") to str)