diff --git a/python-variables/employees.py b/python-variables/employees.py index fa77066161..2210b30ac1 100644 --- a/python-variables/employees.py +++ b/python-variables/employees.py @@ -5,7 +5,7 @@ def __init__(self, name, position, salary): self.name = name self.position = position self.salary = salary - type(self).count += 1 + Employee.count += 1 def display_profile(self): print(f"Name: {self.name}") diff --git a/python-variables/scopes.py b/python-variables/scopes.py index f770538425..309df9795b 100644 --- a/python-variables/scopes.py +++ b/python-variables/scopes.py @@ -15,8 +15,8 @@ def inner_func(): # Local scope local_variable = "local" print(f"Hi from the '{local_variable}' scope!") - print(f"Hi from the '{global_variable}' scope!") print(f"Hi from the '{nonlocal_variable}' scope!") + print(f"Hi from the '{global_variable}' scope!") inner_func()