Page 1 sur 1

Python syntax.

Publié : mer. févr. 27, 2019 10:35 pm
par compsystems
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

Re: Python syntax.

Publié : jeu. févr. 28, 2019 6:53 am
par parisse
You mean ; followed by a comment?
Sorry, this does not seems to be supported, but it's not important because it's not the way people would write this in Python syntax.