String Indexes
Access characters by their index
Published in
1 min readMar 12, 2018
→ Lab Assignment: “String Indexes” on repl.it
How to access a character by index:
string = "PYTHON ROCKS"
print( string[0] )
print( string[1] )
print( string[6] )
print( string[-1] )
print( string[-2] )
Output:
P
YS
K