python 3.8.1
Hey! I don't know why this code doesn't run with python3.8.1, i thought the codes were the same in python3. help please ! :( This is the code with the mistakes Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> class Animal: ... def __init__(self, name, color): ... self.name = name ... self.color = color ... >>> class Cat(Animal) File "<stdin>", line 1 class Cat(Animal) ^ SyntaxError: invalid syntax >>> def purr(self) File "<stdin>", line 1 def purr(self) ^ IndentationError: unexpected indent >>> print("Purr...") File "<stdin>", line 1 print("Purr...") ^ IndentationError: unexpected indent >>> >>> class Dog(Animal): ... def bark(self): ... print("Woof!") ... >>> fido = Dog("Fido", "brown") >>> print(fido.color) brown >>> fido.bark()