Because in this case the list you are splitting is ['adam', 'smith']
. So, bob[0].split()[1]
would return the 2nd element (don't forget list indexes are 0-based) and bob[0].split()[-1]
would return that last element.
Since the size of the list is 2, the second (index 1
) and last (index -1
) are the same.
In general if you have a list my_list
, then my_list[len(my_list) - 1] == my_list[-1]