Python Quest

Track 11 · Lesson 3 of 12

Methods

Give objects behaviour with instance methods that change their state or report on it, and chain calls by returning self.

About 40 minBeginner5 exercises

You will be able to

  • Define instance methods and call them on objects
  • Distinguish methods that change an object's state from methods that return a value
  • Call one method from another through self
  • Validate method arguments so an object's state stays consistent
  • Return self to allow method chaining

Included with a Formula Quest membership

It has 5 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.

View Formula Quest memberships

Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.