Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

static methods in python

class Calculator:

    # create addNumbers static method
    @staticmethod
    def addNumbers(x, y):
        return x + y

print('Product:', Calculator.addNumbers(15, 110))
Source by www.journaldev.com #
 
PREVIOUS NEXT
Tagged: #static #methods #python
ADD COMMENT
Topic
Name
3+2 =