Merge pull request #3413 from nielsbom/patch-2

[python3/en] show chaining operators nicer
This commit is contained in:
Divay Prakash 2018-12-01 10:00:58 +05:30 committed by GitHub
commit 1fd955ae64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,7 +105,10 @@ bool(-6) # => True
2 <= 2 # => True 2 <= 2 # => True
2 >= 2 # => True 2 >= 2 # => True
# Comparisons can be chained! # Seeing whether a value is in a range
1 < 2 and 2 < 3 # => True
2 < 3 and 3 < 2 # => False
# Chaining makes this look nicer
1 < 2 < 3 # => True 1 < 2 < 3 # => True
2 < 3 < 2 # => False 2 < 3 < 2 # => False