Skip to content

Commit 7291cf4

Browse files
authoredFeb 28, 2025··
fix typo (#58)
1 parent f9b7802 commit 7291cf4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎docs/arithmetic-operation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ print("Updated num2 after decrement:", num2)
113113
| Remainder | `%` | `%` |
114114
| Exponentiation | `**` | `**` |
115115
| Increment | `++` <br /> `+=1` | `+= 1` |
116-
| Decrement | `--` <br/> `+=1` | `-= 1` |
116+
| Decrement | `--` <br/> `-=1` | `-= 1` |
117117

118118
:::danger
119119
In Python, arithmetic operations can only be performed between **compatible** data types. For example, the result of a calculation between a floating-point number and an integer will be a floating-point number. However, performing arithmetic operations between a string and a number will result in an error. To perform arithmetic operations between a number and a string, one of them must be converted to the appropriate data type.

‎i18n/zh-cn/docusaurus-plugin-content-docs/current/arithmetic-operation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ print("自减后的 num2:", num2)
113113
| 取余 | `%` | `%` |
114114
| 指数运算 | `**` | `**` |
115115
| 自增 | `++` <br /> `+=1` | `+= 1` |
116-
| 自减 | `--` <br/> `+=1` | `-= 1` |
116+
| 自减 | `--` <br/> `-=1` | `-= 1` |
117117

118118
:::danger
119119
在 Python 中,只有 **兼容的** 数据类型之间才能进行运算,比如浮点数和整数运算的结果为浮点数,而字符串和数字进行运算会抛出异常。如要对数字和字符串进行运算,需先对其中一进行类型转换。

0 commit comments

Comments
 (0)
Please sign in to comment.