Python · Stage 9 – Intro to Objects · Lesson 44 of 50

What Is an Object?

See an object as a thing with stored properties and available actions.

You have already used objects. A string is an object with methods:

name = "maya"
loud_name = name.upper()
Line-by-line explanation
  1. The first line creates a string object.
  2. name.upper selects its upper method.
  3. The method call creates MAYA.
  4. That new string is stored.

Tiny Practice

Call the lower method on the string.

Starter template

word = "HELLO"
small = CHANGE_ME
Line-by-line explanation
  1. Word is a string object.
  2. Strings have a lower method.
Hint
  1. Start with word.
  2. Use a dot.
  3. Call lower().
Show Solution
word = "HELLO"
small = word.lower()
Line-by-line explanation
  1. Word stores the object.
  2. Lower creates a lowercase string.
  3. Small stores hello.