Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

oggetto di tipo Attore

V
Virtnet (1230 points)
4 32 43
in Es3 by (1.2k points)
Ciao ,
Io non capisco cosa dovrei fare all'inizio dell'esercizio ,cosa ho fatto è:

Ho fatto un nuovo dizinario catalogo_attori, ho fatto un ciclo e ho messo come le chiave i NOMI i le altre informazione di stesso nome.

Per esempio {'NOME' : {LAST NAME:'',....}} e dopo torno il dizinario

Mi da' questo errore "<class 'dict'> != <class 'program03.Attore'>"

Non riesco a capire cosa significa { nome -> oggetto di tipo Attore }

Se potete spiegare questo questa cosa in L'Inglese ,forse potrò capire meglio :/

Vi ringrazio tanto.
338 views
closed

1 Answer

Best answer
Xriuk (13590 points)
8 24 116
by (13.6k points)
selected by

You don't have to just create a dict of other dicts, you have to implement a class called Attore and then return a dict with the actors' names as keys (and I think you got it) but the values must be instances of the class Attore. You have to pass all the stuff you now have as the dict value (LAST_NAME, ...) to the class constructor:

def __init__(self, data):

At the end you will have something like this:

{"NOME1": Attore(...), "NOME2": Attore(...), ...}
V
Virtnet (1230 points)
4 32 43
by (1.2k points)
Grazie tanto Xriuk ,ma dentro Class Attore() , come faccio controlare cosa mando? In senso ogni volta dovrei fare run sull'esercizio?
d
davide.scrimieri (2930 points)
5 16 39
by (2.9k points)
controlli cosa mandi attraverso i parametri passati al  costruttore __init__ .