Skip to content
Open
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
Use bool instead of True if else False.
* source/c01/c01_31.md
* source/c01/c01_31.rst
  • Loading branch information
nasyxx committed Jun 25, 2021
commit 84f0d19f3cfd1266be2885bd0c65286c7ec82d23
4 changes: 2 additions & 2 deletions source/c01/c01_31.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ hello world
>>> msg='hello----world'
>>> msg.split('-')
['hello', '', '', '', 'world']
>>>
>>> filter(lambda item: True if item else False, msg.split('-'))
>>>
>>> filter(bool, msg.split('-'))
['hello', 'world']
```

Expand Down
4 changes: 2 additions & 2 deletions source/c01/c01_31.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
>>> msg='hello----world'
>>> msg.split('-')
['hello', '', '', '', 'world']
>>>
>>> filter(lambda item: True if item else False, msg.split('-'))
>>>
>>> filter(bool, msg.split('-'))
['hello', 'world']

|image2|
Expand Down