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

Do you need help?

Type error es2 hw3

g
gianluca (1270 points)
2 12 19
in Info sul corso e sugli esami by (1.3k points)
edited by
ciao a tutti mi da quest'eerore quando creo la matrice:

                           TypeError: 'method' object cannot be interpreted as an integer  

come trasformo il metodo per esempio(larghezza) in un intero per metterlo in un range? con il int(metodo) mi da cmq errore

forse non avevo aggiunto le parentesi vuote alla fine? ma che funzione hanno le parentesi vuote messe alla fine del metodo?
370 views
closed

2 Answers

Best answer
K
Khalester (3310 points)
2 5 24
by (3.3k points)
selected by
Se il tuo metodo larghezza(self) ritorna un intero, allora ti basta soltanto chiamare il metodo ovvero aggiungere le parentesi alla fine.
g
gvenanzi (1650 points)
2 2 11
by (1.7k points)
IL nome del metodo rappresenta l'indirizzo in memoria del metodo, quindi il metodo stesso,

il metodo con alla fine () indica il ritorno del metodo, cioè svolge il metodo e ritorna il risultato.