1. Learn
  2. /
  3. Courses
  4. /
  5. Software Engineering Principles in Python

Exercise

Creating a grandchild class

In this exercise you will be using inheritance to create a Tweet class from your SocialMedia class. This new grandchild class of Document will be able to tackle Twitter specific details such as retweets.

Instructions

100 XP
  • Complete the class statement so that Tweets inherits from SocialMedia. SocialMedia has already been loaded in your environment.
  • Use super() to call the __init__ method of the parent class.
  • Define retweet_text. Use help() to complete the call to filter_lines with the correct parameter name. filter_lines has already been loaded in your environment.
  • return retweet_text from _process_retweets as an instance of SocialMedia.