Относительно вашей ошибки:
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.
Это потому, что range()
потребности функций integers
как аргументы.
Когда вы это сделаете rheight = height*0.4
, в качестве 0.4
является номером плавающей запятой, интерпретатор Python/Jython вычисляет «высота*0,4» как поплавок. В результате чего «rheight» является поплавком.
Исправить: Вы должны явно cast
Значение как целое число:
rheight = int(height*0.4)