79609545

Date: 2025-05-06 22:00:57
Score: 0.5
Natty:
Report link

Please include your code. Including your code makes communicating and solving problems much easier. Aside from that, does the number represent an arbitrary index or is this number a representation of an important order such as a ranking or a priority?

I believe you are looking for Python collections: Lists, Dictionaries, Sets, and Tuples.

Your solution could be a simple List containing a Tuple of two values: your movie and your number. However dictionaries already do this very well. Dictionaries are represented with key-value-pairs. You could have a dictionary with keys as numbers and values as a movie.

movies = {
            1: "Hellraiser",
            2: "From Dusk till Dawn",
            3: "Army of Darkness"
        }

Dictionaries already have built in ways of doing CRUD (create, read, update, delete) that are useful for what you are trying to do.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: LifeAsPixels