بخصوص الخطأ:
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
هو النقطة العائمة رقم الثعبان/jython مترجم يحسب "height*0.4" كما تطفو كذلك.مما أدى إلى "rheight" يجري تعويم.
Fix: عليك صراحة cast
القيمة كما يجري عدد صحيح:
rheight = int(height*0.4)