Em relação ao seu erro:
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.
Isso é porque o range()
necessidades de função integers
como argumentos.
Quando você faz rheight = height*0.4
, Como 0.4
é um número de ponto flutuante, o intérprete Python/Jython também calcula "altura*0.4" como um bóia. Resultando em "rhight" sendo um flutuador.
Fixar: você tem que explicitamente cast
O valor como sendo um número inteiro:
rheight = int(height*0.4)