mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-11 17:24:29 +02:00
[python/en] added int div, modulo, and scoping
Added integer or truncation division, the modulo operator which were missing from operators section. Added function scoping in the functions section.
This commit is contained in:
@@ -47,7 +47,7 @@ to Python 2.x. Look for another tour of Python 3 soon!
|
|||||||
|
|
||||||
# Truncation or Integer division
|
# Truncation or Integer division
|
||||||
5 // 3 # => 1
|
5 // 3 # => 1
|
||||||
5.0 // 3.0 # => 1.0
|
5.0 // 3.0 # => 1.0 # works on floats too
|
||||||
|
|
||||||
# Modulo operation
|
# Modulo operation
|
||||||
7 % 3 # => 1
|
7 % 3 # => 1
|
||||||
|
Reference in New Issue
Block a user