Software-engineeringprincipes in Python
Adam Spannbauer
Machine Learning Engineer at Eastman




class Parent: def __init__(self): print("Ik ben een ouder!") class Child(Parent): def __init__(self): Parent.__init__() print("Ik ben een kind!")class SuperChild(Child): def __init__(self): super().__init__() print("Ik ben een superkind!")
class Parent: def __init__(self): print("Ik ben een ouder!") class SuperChild(Parent): def __init__(self): super().__init__() print("Ik ben een superkind!")class Grandchild(SuperChild): def __init__(self): super().__init__() print("Ik ben een kleinkind!")grandchild = Grandchild()
Ik ben een ouder!
Ik ben een superkind!
Ik ben een kleinkind!
# Maak een instantie van SocialMedia sm = SocialMedia('@DataCamp #DataScience #Python #sklearn')# Welke methoden heeft sm? ¯\_(ツ)_/¯ dir(sm)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__',
'__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__',
'__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__',
'__str__', '__subclasshook__', '__weakref__', '_count_hashtags',
'_count_mentions', '_count_words', '_tokenize', 'hashtag_counts',
'mention_counts', 'text', 'tokens', 'word_counts']
Software-engineeringprincipes in Python