In Bezug auf Ihren Fehler:
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.
Das liegt daran, dass die range()
Funktionsbedürfnisse integers
als Argumente.
Wenn Sie das tun rheight = height*0.4
, wie 0.4
ist eine schwimmende Punktzahl, der Python/Jython -Interpreter berechnet "Höhe*0,4" ebenfalls als Schwimmer. Was dazu führt, dass "Rheight" ein Schwimmer ist.
Fix: Sie müssen explizit cast
Der Wert als Ganzzahl:
rheight = int(height*0.4)