moved import to top of class

This commit is contained in:
Mark McIntyre 2022-06-28 18:03:50 -04:00
parent 10c73653cf
commit 5cd80e5354

View File

@ -1,5 +1,7 @@
class Calculator(): class Calculator():
from math import log
def __init__(self): def __init__(self):
self.total = 0.0 self.total = 0.0
self.actions = [] self.actions = []
@ -75,8 +77,6 @@ class Calculator():
self.actions.append(f" = {self.total}") self.actions.append(f" = {self.total}")
def log(self, val): def log(self, val):
from math import log
print(log(val)) print(log(val))
self.actions.append(f"log({val})") self.actions.append(f"log({val})")