I\'ve tried to look around the web for answers to splitting a string into an array of characters but I can\'t seem to find a simple method
str.split(//)
If you wish to read only access to the string you can use array notation directly.
Python 2.7.6 (default, Mar 22 2014, 22:59:38)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> t = 'my string'
>>> t[1]
'y'
Could be useful for testing without using regexp. Does the string contain an ending newline?
>>> t[-1] == '\n'
False
>>> t = 'my string\n'
>>> t[-1] == '\n'
True