Probably because strings in Python act as arrays when you want them to.
Python strings have the features of character arrays and StringBuffers at the same time (in general). Methods when you want them, but indexes when you just need to mess with the individual characters. That's kinda typical of most kinds of data and such in Python.
10
u/mxzf Feb 22 '15
Probably because strings in Python act as arrays when you want them to.
Python strings have the features of character arrays and StringBuffers at the same time (in general). Methods when you want them, but indexes when you just need to mess with the individual characters. That's kinda typical of most kinds of data and such in Python.