Hi,
I am working on an assignment for Python for Dummies and i have to enter a code but somehow it doesn't work. What am i doing wrong? And should the two blank lines between the codelines be only one sentence? Any input is appreciated!
The code in the book is:
I am working on an assignment for Python for Dummies and i have to enter a code but somehow it doesn't work. What am i doing wrong? And should the two blank lines between the codelines be only one sentence? Any input is appreciated!
The code in the book is:
class MyClass:
Greeting = ""
def __init__(self, Name="daar"):
self.Greeting = Name + "!"
def SayHello(self):
print("Hallo {0}".format(self.Greeting))When i enter this code in the Shell i get this:>>> class MyClass: Greeting = "" >>> def__init(self, Name="daar"): SyntaxError: invalid syntax >>>
