Skip to content

Instantly share code, notes, and snippets.

@Plasma0909
Last active October 11, 2022 08:15
Show Gist options
  • Save Plasma0909/28f01d77f29e96f1fc1155ce20bc8d2a to your computer and use it in GitHub Desktop.
Save Plasma0909/28f01d77f29e96f1fc1155ce20bc8d2a to your computer and use it in GitHub Desktop.
arithmethic_operator ( 算術演算子 )
演算子説明補足
A + B加算
A - B減算
A * B乗算
A ** n冪(べき)乗Aの実数乗
A / B除算()分数とは異なる。
A // B除算(商の整数部分のみ)int(A / B)に同じ
A % B除算(余り)
+(単項)被演算子の符号をそのままとする+(a-1) → a-1
-(単項)被演算子の符号を反転する-(a-1) → -a+1
演算子説明補足
"A"+"B"テキストの連結str(A) + str(B) に同じ
"A" ** nテキストの繰り返し(n回)str(A) ** n に同じ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment