May 13, 2024, 2:18 a.m. | Kumatso1

DEV Community dev.to

I wrote this Python code but it is giving me this error shown in the screenshot and I don't know where it is coming from. I am a beginner in Python.



Program:

"""

This program defines the Album class with the specified attributes and string representation.

Then, it creates two lists albums1 and albums2, populates them with Album objects,

and performs various operations like sorting, swapping, copying, adding elements, and searching.

"""

class Album: # defineing Album class

def init …

beginner class code error giving lists python representation searching sorting string

Doctoral Researcher (m/f/div) in Automated Processing of Bioimages

@ Leibniz Institute for Natural Product Research and Infection Biology (Leibniz-HKI) | Jena

Seeking Developers and Engineers for AI T-Shirt Generator Project

@ Chevon Hicks | Remote

Principal Research Engineer - Materials

@ GKN Aerospace | Westlake, TX, US

Internship in Data and Projects

@ Bosch Group | Mechelen, Belgium

Research Scientist- Applied Mechanics

@ Corning | Pune, MH, IN, 410501

Product Data Analyst

@ AUTODOC | Lisbon-remote