python static python code example
Example 1: static methods in python
class Calculator:
def addNumbers(x, y):
return x + y
# create addNumbers static method
Calculator.addNumbers = staticmethod(Calculator.addNumbers)
print('Product:', Calculator.addNumbers(15, 110))
Example 2: cls in python
import os
clear = lambda: os.system('cls')