1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-06 14:56:54 +02:00

[python/en] Correct floor division examples (#4993)

This commit is contained in:
tomaszn
2024-07-04 21:29:51 +02:00
committed by GitHub
parent aed24ef788
commit 4825b6039d

View File

@@ -39,7 +39,7 @@ syntactic clarity. It's basically executable pseudocode.
10 * 2 # => 20 10 * 2 # => 20
35 / 5 # => 7.0 35 / 5 # => 7.0
# Integer division rounds towards zero for both positive and negative numbers. # Floor division rounds towards negative infinity
5 // 3 # => 1 5 // 3 # => 1
-5 // 3 # => -2 -5 // 3 # => -2
5.0 // 3.0 # => 1.0 # works on floats too 5.0 // 3.0 # => 1.0 # works on floats too