Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exponentiation operation - Power Operation - constant - varible term - coefficient

class Operation:
    def __init__(self,constant,varilbe_term,coefficient):
        pass
    def __pow__(self,*args):
        return x*n
    def 
A = Operation()
n = 1 or 2 or 3
A ** n

Symbol(x)

  • __pow__ methods:
  • __sub__ methods:
  • __rsub__ methods:
  • __neg__ methods:
  • __sub__ methods:
  • __rsub__ methods:
  • __mul__ methods:
  • __rmul__ methods: