Skip to content
Advertisement

Tag: operator-keyword

New operators in Python

We can define intrinsic operators of Python as stated here. Just for curiosity, can we define new operators like $ or ***? (If so, then we can define ternary condition operators or rotate operators.) Answer Expanding on @fasouto answer, but adding a bit more code. While you cannot define new operators AND you cannot redefine existing operators for built-in types,

Advertisement