I know that enumerate function gives a index and element, repectively.
for idx, batch in enumerate(['A', 'B', 'C']):
print(batch[0])
results :
A
B
C
is okay, while
print(batch[1])
gets error, string index out of range.
What I want to ask is,
for idx, batch in enumerate(['A', 'B', 'C']):
print(batch[0:6])
get result
A
B
C
especially, it is not just for 6. 7,8, or anything bigger than 0(integer) makes the result.
Also, batch[0:0] did not make an error. Why is that?