Skip to content

Commit 50cc8f3

Browse files
committed
Cleaned up in-line comments per PR review.
1 parent 7786d22 commit 50cc8f3

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

concepts/strings/about.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ If a `list`, `tuple`, `set` or other collection of individual strings needs to b
173173

174174
```python
175175
# str.join() makes a new string from the iterables elements.
176-
>>> chickens = ["hen", "egg", "rooster"] #lists are iterable
176+
>>> chickens = ["hen", "egg", "rooster"] # Lists are iterable.
177177
>>> ' '.join(chickens)
178178
'hen egg rooster'
179179

@@ -186,29 +186,29 @@ If a `list`, `tuple`, `set` or other collection of individual strings needs to b
186186

187187

188188
# Any iterable can be used as input.
189-
>>> flowers = ("rose", "daisy", "carnation") #tuples are iterable
189+
>>> flowers = ("rose", "daisy", "carnation") # Tuples are iterable.
190190
>>> '*-*'.join(flowers)
191191
'rose*-*daisy*-*carnation'
192192

193-
>>> flowers = {"rose", "daisy", "carnation"} #sets are iterable, but output order is not guaranteed.
193+
>>> flowers = {"rose", "daisy", "carnation"} # Sets are iterable, but output order is not guaranteed.
194194
>>> '*-*'.join(flowers)
195195
'rose*-*carnation*-*daisy'
196196

197-
>>> phrase = "This is my string" #strings are iterable, but be careful!
197+
>>> phrase = "This is my string" # Strings are iterable, but be careful!
198198
>>> '..'.join(phrase)
199199
'T..h..i..s.. ..i..s.. ..m..y.. ..s..t..r..i..n..g'
200200

201201

202202
# Separators are inserted **between** elements, but can be any string (including spaces).
203203
# This can be exploited for interesting effects.
204204
>>> under_words = ['under', 'current', 'sea', 'pin', 'dog', 'lay']
205-
>>> separator = ' ⤴️ under' #note the leading space, but no trailing space.
205+
>>> separator = ' ⤴️ under' # note the leading space, but no trailing space.
206206
>>> separator.join(under_words)
207207
'under ⤴️ undercurrent ⤴️ undersea ⤴️ underpin ⤴️ underdog ⤴️ underlay'
208208

209209
# The separator can be composed different ways, as long as the result is a string.
210210
>>> upper_words = ['upper', 'crust', 'case', 'classmen', 'most', 'cut']
211-
>>> separator = ' 🌟 ' + upper_words[0] #this becomes one string, similar to ' ⤴️ under'.
211+
>>> separator = ' 🌟 ' + upper_words[0] # this becomes one string, similar to ' ⤴️ under'.
212212
>>> separator.join(upper_words)
213213
'upper 🌟 uppercrust 🌟 uppercase 🌟 upperclassmen 🌟 uppermost 🌟 uppercut'
214214
```

exercises/concept/little-sisters-vocab/.docs/introduction.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ If a `list`, `tuple`, `set` or other collection of individual strings needs to b
5050

5151
```python
5252
# str.join() makes a new string from the iterables elements.
53-
>>> chickens = ["hen", "egg", "rooster"] #lists are iterable
53+
>>> chickens = ["hen", "egg", "rooster"] # Lists are iterable.
5454
>>> ' '.join(chickens)
5555
'hen egg rooster'
5656

@@ -63,15 +63,15 @@ If a `list`, `tuple`, `set` or other collection of individual strings needs to b
6363

6464

6565
# Any iterable can be used as input.
66-
>>> flowers = ("rose", "daisy", "carnation") #tuples are iterable
66+
>>> flowers = ("rose", "daisy", "carnation") # Tuples are iterable.
6767
>>> '*-*'.join(flowers)
6868
'rose*-*daisy*-*carnation'
6969

70-
>>> flowers = {"rose", "daisy", "carnation"} #sets are iterable, but output order is not guaranteed.
70+
>>> flowers = {"rose", "daisy", "carnation"} # Sets are iterable, but output order is not guaranteed.
7171
>>> '*-*'.join(flowers)
7272
'rose*-*carnation*-*daisy'
7373

74-
>>> phrase = "This is my string" #strings are iterable, but be careful!
74+
>>> phrase = "This is my string" # Strings are iterable, but be careful!
7575
>>> '..'.join(phrase)
7676
'T..h..i..s.. ..i..s.. ..m..y.. ..s..t..r..i..n..g'
7777

0 commit comments

Comments
 (0)