class Calculator:
# create addNumbers static method
@staticmethod
def addNumbers(x, y):
return x + y
print('Product:', Calculator.addNumbers(15, 110))
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'checkstatic/static/')
]
def squares(length):
for n in range(length):
yield n ** 2
Code language: Python (python)
class A(object):
@staticmethod
def stat_meth():
print("Look no self was passed")
>>> a = A()
>>> a.stat_meth()
Look no self was passed