Python syntax.
Publié : mer. févr. 27, 2019 10:35 pm
hello BP
if the last instruction ends with;, generates error
17 / 3; # classic division
17 / 3.; # approximate value calculation
17 // 3; # floor division discards the fractional part
17 % 3; # the % operator returns the remainder of the division
5 * 3 + 2; # result * divisor + remainder
[enter] error
17 / 3; # classic division
17 / 3.; # approximate value calculation
17 // 3; # floor division discards the fractional part
17 % 3; # the % operator returns the remainder of the division
5 * 3 + 2 # result * divisor + remainder
[enter]
17/3, 5.66666666667, 5, 2, 17
if the last instruction ends with;, generates error
17 / 3; # classic division
17 / 3.; # approximate value calculation
17 // 3; # floor division discards the fractional part
17 % 3; # the % operator returns the remainder of the division
5 * 3 + 2; # result * divisor + remainder
[enter] error
17 / 3; # classic division
17 / 3.; # approximate value calculation
17 // 3; # floor division discards the fractional part
17 % 3; # the % operator returns the remainder of the division
5 * 3 + 2 # result * divisor + remainder
[enter]
17/3, 5.66666666667, 5, 2, 17