Is An Element of a Sequence an Object?
Jon Forrest
nobozo at gmail.com
Sat Jun 3 15:10:40 EDT 2017
I'm learning about Python. A book I'm reading about it
says "... a string in Python is a sequence. A sequence is an ordered
collection of objects". This implies that each character in a string
is itself an object.
This doesn't seem right to me, but since I'm just learning Python
I questioned the author about this. He gave an example the displays
the ids of string slices. These ids are all different, but I think
that's because the slicing operation creates objects.
I'd like to suggest an explanation of what a sequence is
that doesn't use the word 'object' because an object has
a specific meaning in Python.
Am I on the right track here?
Cordially,
Jon Forrest
More information about the Python-list
mailing list