Regarding your error:
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.
This is because the range()
function needs integers
as arguments.
When you do rheight = height*0.4
, as 0.4
is a floating point number, the python/jython interpreter computes "height*0.4" as a float as well. Resulting in "rheight" being a float.
Fix: you have to explicitly cast
the value as being an integer:
rheight = int(height*0.4)