In the following code:
In [5]: if 2 > 1 & 1 > 0:
...: print("True")
...:
True
I know that:
>
is comparative operator,
&
is logic/bitwise operator,
=
is assignment operator,
How about colon :
? How could I name it an abstract concept rather than colon:
In [6]: def foo(): return 3
In [7]: foo()
Out[7]: 3
In the above codes, :
act as =
assignment.
I checked the official docs2. Lexical analysis — Python 3.6.6 documentation
2.6. Delimiters
The following tokens serve as delimiters in the grammar:
( ) [ ] { }
, : . ; @ = ->
+= -= *= /= //= %= @=
&= |= ^= >>= <<= **=
The period can also occur in floating-point and imaginary literals.
I noticed that all the delimiters have appropriate meaning: ( for tuple, [ for list constructor, @ for decorator, ,
for true delimiter, .
for attribute access.
Excluding :
?
How could I name it in a meaning way?