Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bugfix: avoid use built-in function sum as variable #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/arithmetic-operation.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ num1 = 10
num2 = 5

# 1. Addition
sum = num1 + num2
print("Sum:", sum)
sum_val = num1 + num2
print("Sum:", sum_val)

# 2. Subtraction
difference = num1 - num2
Expand Down Expand Up @@ -98,6 +98,7 @@ print("Updated num2 after decrement:", num2)

### Code Highlight
- The syntax for addition, subtraction, multiplication, division, remainder, and exponentiation in Python is the same as in JavaScript.
- sum is the [Built-in Function](https://docs.python.org/3/library/functions.html?highlight=sum#sum) in Python, it is important to avoid using it.
- Python does not have the `++` and `--` operators. Instead, `+=` and `-=` are used to increment or decrement variables.

### Difference Quick View
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ num1 = 10
num2 = 5

# 1. 相加
sum = num1 + num2
print("和:", sum)
sum_val = num1 + num2
print("和:", sum_val)

# 2. 相减
difference = num1 - num2
Expand Down Expand Up @@ -98,6 +98,7 @@ print("自减后的 num2:", num2)

### 代码解读
- Python 的加、减、乘、除、取余、指数运算语法与 JavaScript 一致。
- sum 在Python中是 [内置函数](https://docs.python.org/3/library/functions.html?highlight=sum#sum),在编写代码时应避免使用。
- Python 中没有 `++` 和 `--` 运算符,需要使用 `+=` 和 `-=` 对变量进行自增或自减。

### 差异速览
Expand Down

AltStyle によって変換されたページ (->オリジナル) /