L03 ยท T2 Week 2 ๐ŸŽฏ CT5-DPM-01 ยท CT5-THI-01 ๐Ÿ“‚ Phase 1 โ€” Python Refresher

Lesson 3: Classes Part 1 โ€” Attributes + Methods

๐Ÿ“ L03 Classes Part 1 โ€” Self-Check Handout Open โ†’
21 questions ยท 75 marks ยท 75 min target. Covers the class keyword, __init__, self, attributes, methods, and creating instances โ€” every concept is brand-new today. Same submit-and-score flow as L01/L02.

Learning Intentions

Success Criteria

๐Ÿ“ Do Now โ€” Error of the Day

Fix this broken code: class Dog: def bark: print('Woof!') โ€” what's missing? (Three things.)

๐Ÿ‘ I Do โ€” Teacher Demo

Live-code a Character class: (1) define class with def __init__(self, name, hp); (2) add take_damage method; (3) create hero + enemy instances; (4) show what self refers to.

๐Ÿค We Do โ€” Build Together

Class builds together: Character class with 3 attributes + 2 methods. Create 2 instances. Have them attack each other once.

๐Ÿš€ You Do โ€” Your Turn

Arcade quests below focus on class creation + self. Then: write your OWN Character class with the attributes you want for your game. Test it runs.

  • Build a Character class with name + hp + attack
  • Write take_damage(amount) and is_alive() methods
  • Create 2 instances: hero + enemy

๐ŸŽฎ Practice Quests โ€” work through these

Loading practice quests for this lesson...

Three tiers โ€” pick yours

Support

starter class with __init__ pre-written; fill in the methods. Visual diagram: class vs instance

Core

Follow the plan as written. Attempt the arcade quests above at your own pace.

Extension

Complete all quests above + try a Boss battle for bonus XP. Help a classmate if you finish.

Extensions

๐Ÿ“ Exit Ticket โ€” Coding Journal

Journal: what's one thing about classes that clicked for you today? What's still confusing?

Evidence of Learning

Student's character_class.py runs; hero and enemy can exchange attacks.

โ† PreviousLesson L02โ†‘ HubAll LessonsNext โ†’Lesson L04