Jun-10-2017, 08:58 PM
bridge_knight = "I seek the bravest and the finest knights in the land who will join me in my court at Camelot."When I run len(bridge_knight) the output is 94. So this identifies 0-93 totaling 94 characters; I get that. But what I don't get is the output using bridge_knight[:53]. Is that identifying it as 0-52? If so, then why do I get the space (character 53 in my string) when I use bridge_knight[53:94]?
I am struggling with the logic here:
bridge_knight[94] outputs string index out of range which is correct, there is no 94, it relies on 0-93.
So why do I get a period when I run bridge_knight[53:94] and not when I run bridge_knight[53:93]? The two sites I just deleted from my faves says it counts to 94 and includes it, which, when I run these codes, my eyes and brain de-myths (that is so not a word!).
bridge_knight[93] outputs "." which is the last of 94, that starting with 0. It makes perfect sense. So why do I need to run bridge_knight[##:94] to see it? Does the : mean up to 94, but not including like my brain and eyeballs are telling me?
I need to take a break, I've been at this computer for four hours writing code and completing this book; I need to clear my head. This is all confusing all of a sudden. Why do the Python's forsake me? Those sly, slithery snakes!