Per quanto riguarda il tuo errore:
The error was: 1st arg can't be coerced to int
Inappropriate argument type.
An attempt was made to call a function with a parameter of an invalid type.
This means that you did something such as trying to pass a string to a method
that is expecting an integer.
Questo perché il range()
esigenze di funzione integers
come argomenti.
Quando lo fai rheight = height*0.4
, come 0.4
è un numero di punto galleggiante, l'interprete Python/Jython calcola "altezza*0,4" anche come galleggiante. Con conseguente "reight" essere un galleggiante.
Aggiustare: devi esplicitamente cast
il valore come intero:
rheight = int(height*0.4)