Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ A [`generator-expression`][generator-expression] is then used to iterate through

Generator expressions are short-form [generators][generators] - lazy iterators that produce their values _on demand_, instead of saving them to memory.
This generator expression is consumed by [`str.join()`][str-join], which joins the generated letters together using an empty string.
Other "seperator" strings can be used with `str.join()` - see [concept:python/string-methods]() for some additional examples.
Other "separator" strings can be used with `str.join()` - see [concept:python/string-methods]() for some additional examples.
Since the generator expression and `join()` are fairly succinct, they are put directly on the `return` line rather than assigning and returning an intermediate variable for the acronym.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ As of this writing, both of these methods benchmark slower than using `str.repla

A [`list comprehension`][list comprehension] is then used to iterate through the phrase and select the first letters of each word via [`bracket notation`][subscript notation].
This comprehension is passed into [`str.join()`][str-join], which unpacks the `list` of first letters and joins them together using an empty string - the acronym.
Other "seperator" strings besides an empty string can be used with `str.join()` - see [concept:python/string-methods]() for some additional examples.
Other "separator" strings besides an empty string can be used with `str.join()` - see [concept:python/string-methods]() for some additional examples.
Since the comprehension and `join()` are fairly succinct, they are put directly on the `return` line rather than assigning and returning an intermediate variable for the acronym.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Note that when using `finditer()`, the `Match object` has to be unpacked via `ma

Generator expressions are short-form [generators][generators] - lazy iterators that produce their values _on demand_, instead of saving them to memory.
This generator expression is consumed by [`str.join()`][str-join], which joins the generated letters together using an empty string.
Other "seperator" strings can be used with `str.join()` - see [concept:python/string-methods]() for some additional examples.
Other "separator" strings can be used with `str.join()` - see [concept:python/string-methods]() for some additional examples.


Finally, the result of `.join()` is capitalized using the [chained][chaining] [`.upper()`][str-upper].
Expand Down
Loading