Skip to content

Commit 37f9135

Browse files
committed
fix more stuff
1 parent 329e451 commit 37f9135

File tree

6 files changed

+4
-2
lines changed

6 files changed

+4
-2
lines changed

handy-stuff-strings.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ That's interesting. We got a string that is only one character long. But
103103
the first character of `Hello World!` should be `H`, not `e`, so why did
104104
we get an e?
105105

106-
Prograhttps://pyformat.info/mming starts at zero. Indexing strings also starts at zero. The
106+
Programming starts at zero. Indexing strings also starts at zero. The
107107
first character is `our_string[0]`, the second character is
108108
`our_string[1]`, and so on.
109109

@@ -119,13 +119,15 @@ How about negative values?
119119
>>>
120120
```
121121

122+
We got the last character.
123+
122124
But why didn't that start at zero? `our_string[-1]` is the last
123125
character, but `our_string[1]` is not the first character!
124126

125127
That's because 0 and -0 are equal, so indexing with -0 would do the same
126128
thing as indexing with 0.
127129

128-
So indexing with negative values works like this:
130+
Indexing with negative values works like this:
129131

130132
![Indexing with negative values](images/indexing2.png)
131133

images/drawings.odg

7 Bytes
Binary file not shown.

images/indexing2.png

-376 Bytes
Loading

images/indexing3.png

-412 Bytes
Loading

images/slicing2.png

-390 Bytes
Loading

images/slicing3.png

-386 Bytes
Loading

0 commit comments

Comments
 (0)