This code does not seem to work:
class Dog:
def __init__(self,color):
assert type(color) == 'str', 'Must be string'
self.color = color
dog = Dog('black')
line 26, in __init__ assert type(color) == 'str', 'Must be string'
AssertionError: Must be string
Even though I've used a string. Is their a way to check if a given argument has the correct type?