promptdojo_

Write a class called Score that:

  • Takes no arguments to its __init__ (besides self).
  • Sets self.points to 0 in __init__.
  • Has a method add(self, n) that increases self.points by n.

Then create one instance, call .add(3) and .add(7), and print the final points.

Expected output:

10

this step needs the editor

on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.

open this same url on a laptop to keep going today.