Answers for "Static Methods python"

1

staticmethod python

class math:

    @staticmethod
    def add(x, y):
        return x + y

    @staticmethod
    def add5(num):
        return num + 5

    @staticmethod
    def add10(num):
        return num + 10

    @staticmethod
    def pi():
        return 3.14


x = math.add(10, 20)
y = math.add5(x)
z = math.add10(y)
print(x, y, z)
Posted by: Guest on October-20-2021

Code answers related to "Static Methods python"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language