整数 (int)

すべての整数。詳しくは 数字 をご覧ください。

返される値

整数のオブジェクトは、以下の関数とメソッドによって返されます

整数メソッド

int.is_even()

数が偶数の場合に True を返します。

シグネチャー

bool is_even()


int.is_odd()

数が奇数の場合は True を返します

シグネチャー

bool is_odd()


int.to_string()

数の値を文字列として返します。

シグネチャー

# Returns the value of the number as a string
str to_string(
  int [fill],   # Left fill the string with zeros until it reaches the length
)

引数

メソッド int.to_string() は、次の位置引数を許可します

名前 説明 タグ
fill 整数

文字列をゼロで左側いっぱいまで埋めます。この引数によって指定された文字列長に達するまで。負の符号は長さの中にカウントされ、- 文字の前ではなく後ろにパディングを挿入して処理されます。文字列の長さよりも less が小さかった場合は、元の文字列が返されます。

[オプション]


検索結果は