infix
or prefix
notation.-
operator when used in infix
notation denotes subtraction (2 - 1 # == 1
) whereas with prefix
notation gives negation (-1 # == -1
).infix
notation unless stated otherwise.+
infix
)1 + 2 # == 3
prefix
)+1
-
infix
)2 - 1 # == 1
prefix
)-1
*
2 * 3 # == 6
/
5 / 2 # == 2.5
//
5 // 2 # == 2
%
5 % 2 # == 1
==
1 == 1 # true
!=
1 != 1 # false
is
==
will check if two objects have the same value, is
will check if they are the exact same object (i.e. two variables reference the same object, etc.)true is true # true
not
not false # true
and
true and 1 == 1 # true
or
true or false # true
<
2 < 3 # true
Dog < Animal
>
2 > 3 # false
<=
3 <= 3 # true
>=
3 >= 3 # true
=
let x: int = 3
->
def test() -> int = return 3