I have a folder called pack1, and two python files called Task1 and HelloW. For some reason I'm getting this error:
ImportError: cannot import name 'HelloW'
Here is the code:
# file HelloW
class HelloW:
name = "John Doe"
def print_hello(self):
print("Hello, %s" % self.name)
#file Task1
from pack1 import HelloW
hw = HelloW()
hw.print_hello()