Learning material related to Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

22 lines
373 B

# function.py
class Maths:
"""
A Maths class
n (int) - starting interger value
"""
def __init__(self, n: int):
self.n = n
def add(self, x: int) -> int:
self.n += x
return self.n
def subtract(self, x: int) -> int:
self.n -= x
return self.n
def __repr__(self):
return f"n is {self.n}"