class Track():
    artist = ""
    name = ""
    track_id = ""

    def __init__(self, artist, name, track_id=""):
        self.artist = artist
        self.name = name
        self.track_id = track_id

    @staticmethod
    def from_spotify(self, track):
        track_id = track.get("id")
        name = track.get("name")
        artist = ""
        if "artists" in track:
            artist = track["artists"][0]["name"]

        return Track(artist, name, track_id)

    @staticmethod
    def from_gpm(self, track):
        return Track(
            track.get("artist"),
            track.get("title"),
            track.get("storeId")
        )

class Track():
    artist = ""
    name = ""
    track_id = ""

    def __init__(self, artist, name, track_id=""):
        self.artist = artist
        self.name = name
        self.track_id = track_id

    @classmethod
    def from_spotify(cls, track):
        track_id = track.get("id")
        name = track.get("name")
        artist = ""
        if "artists" in track:
            artist = track["artists"][0]["name"]

        return cls(artist, name, track_id)

    @classmethod
    def from_gpm(cls, track):
        return cls(
            track.get("artist"),
            track.get("title"),
            track.get("storeId")
        )

Change from_spotify and from_gpm to classmethods
Change from_spotify and from_gpm to classmethods

  class Track():
      artist = ""
      name = ""
      track_id = ""
  
      def __init__(self, artist, name, track_id=""):
          self.artist = artist
          self.name = name
          self.track_id = track_id
  
-     @staticmethod
+     @classmethod
-     def from_spotify(self, track):
+     def from_spotify(cls, track):
          track_id = track.get("id")
          name = track.get("name")
          artist = ""
          if "artists" in track:
              artist = track["artists"][0]["name"]
  
-         return Track(artist, name, track_id)
+         return cls(artist, name, track_id)
  
-     @staticmethod
+     @classmethod
-     def from_gpm(self, track):
+     def from_gpm(cls, track):
-         return Track(
+         return cls(
              track.get("artist"),
              track.get("title"),
              track.get("storeId")
          )
  
Change from_spotify and from_gpm to classmethods
## Code Before:
class Track():
    artist = ""
    name = ""
    track_id = ""

    def __init__(self, artist, name, track_id=""):
        self.artist = artist
        self.name = name
        self.track_id = track_id

    @staticmethod
    def from_spotify(self, track):
        track_id = track.get("id")
        name = track.get("name")
        artist = ""
        if "artists" in track:
            artist = track["artists"][0]["name"]

        return Track(artist, name, track_id)

    @staticmethod
    def from_gpm(self, track):
        return Track(
            track.get("artist"),
            track.get("title"),
            track.get("storeId")
        )

## Instruction:
Change from_spotify and from_gpm to classmethods
## Code After:
class Track():
    artist = ""
    name = ""
    track_id = ""

    def __init__(self, artist, name, track_id=""):
        self.artist = artist
        self.name = name
        self.track_id = track_id

    @classmethod
    def from_spotify(cls, track):
        track_id = track.get("id")
        name = track.get("name")
        artist = ""
        if "artists" in track:
            artist = track["artists"][0]["name"]

        return cls(artist, name, track_id)

    @classmethod
    def from_gpm(cls, track):
        return cls(
            track.get("artist"),
            track.get("title"),
            track.get("storeId")
        )
