Mega Code Archive

 
Categories / Python Tutorial / List
 

Indexing

# All elements in a sequence are numbered- from zero and upwards.  # A string is just a sequence of characters.  # The index 0 refers to the first element, in this case the letter H.  greeting = 'Hello' print greeting[0]