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

Do you need help?

Errore es2 HW3

daniel.f (1750 points)
4 20 34
in Es2 by (1.8k points)
closed by
ERROR: test_20b_Skyline_1___s1____verde__ (__main__.Test)
list() -> new empty list
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\DRIVERX\Anaconda3\lib\site-packages\ddt.py", line 145, in wrapper
    return func(self, *args, **kwargs)
  File "C:/Users/DRIVERX/Downloads/homework03 (1)/homework03/test_02.py", line 164, in test_20b_Skyline
    h = s.altezza()
TypeError: 'int' object is not callable

Qualcuno sa dirmi da cosa è dovuto questo errore? prima di questo me li passa tutti e l'altezza e la base sono inizializzati a 0
426 views
closed with the note: Risolto

1 Answer

_andrea_ (45670 points)
11 42 297
by (45.7k points)
forse hai richiamato l'attributo altezza come fosse un metodo, quindi altezza(). ovviamente altezza è un intero, e non puoi chiamarlo come fosse un metodo. infatti int object is not callable dovrebbe significare questo
daniel.f (1750 points)
4 20 34
by (1.8k points)
Questo è il test non l'ho richiamata io come se fosse un metodo
_andrea_ (45670 points)
11 42 297
by (45.7k points)
Però ce l'hai un attributo che si chiama altezza?
daniel.f (1750 points)
4 20 34
by (1.8k points)
Risolto avevo chiamato un attr altezza come il metodo di Skyline e quindi il test richiamava l'attributo.