""" Example from lecture 13 oct. Simple class to represent a mathematical function, where the parameter v0 is a class attribute and t an argument to the function value. """ class Y: def __init__(self, v0): self.v0 = v0 self.g = 9.81 def value(self, t): return self.v0 * t - 0.5 * self.g * t**2 y = Y(v0 = 3) # lag instans (objekt) print(type(y)) print(y.value(0.1)) # beregn funksjonsverdi #print(Y.value(y,0.1)) y2 = Y(v0 = 1) print(y2.value(0.1))