Originally Posted by spinFX
Anything can equal anything depending on how they are compared. A string is a combination of chars. A char has an int value. Therefore each letter has a numeric value and a string can have a numeric value.
Ah thank you I didn't think of it that way. Is the numeric value the same as the index? So the numeric value of each character in "Cheeseburger" would correspond to the index. Or are there other numbers assigned to each character somehow? I guess that wouldn't really work. It would get confused when you have more than one of the same letter. I have never seen these numbers which are assigned to strings. Anti_clockwise posted them but where are they actually located? Some module in python they are being drawn from?
And here is another question for today. I don't get where animal came from, as opposed to animals. To me, animal seems to appear out of nowhere. It was never assigned anything.
animals = ["cat", "ant", "bat"]
for animal in animals: