エラーについて:
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)