← 返回资讯屏轩教育 · 行业资讯

Operators, Expressions and Precedence in Edexcel A-Level Programming | Edexcel A-Level编程运算符、表达式与优先级

2026-08-29 14:59 · 本文部分内容由AI辅助创作

📚 Operators, Expressions and Precedence in Edexcel A-Level Programming | Edexcel A-Level编程运算符、表达式与优先级

In Edexcel A-Level Computer Science, programming questions reward precise use of operators, expressions and precedence. Whether you trace pseudocode or write Python, a single wrong operator can change the entire logic of an algorithm. This revision guide covers the operators and expression rules you need for the qualification.

在Edexcel A-Level计算机科学中,编程题目会考查你对运算符、表达式和优先级的精确使用。无论你是在追踪伪代码还是编写Python,一个错误的运算符都可能改变整个算法的逻辑。本复习指南涵盖本资格认证所需的运算符和表达式规则。


1. Why Operators Matter | 为什么运算符重要

Operators are symbols that tell the computer to perform a specific operation on one or more operands. An expression is a combination of values, variables, operators and function calls that can be evaluated to produce a single result. Edexcel exams test both your ability to read expressions in pseudocode and your ability to write correct expressions in a high-level language such as Python.

运算符是告诉计算机对一个或多个操作数执行特定操作的符号。表达式是由值、变量、运算符和函数调用组成的组合,可以被求值得到单一结果。Edexcel考试既考查你阅读伪代码中表达式的能力,也考查你使用Python等高级语言编写正确表达式的能力。


2. Arithmetic Operators | 算术运算符

and ^. You must recognise each one and know how it behaves with integer and real operands.

Edexcel伪代码中的核心算术运算符是+、-、*、/、DIV、MOD和^。你必须认识每一个运算符,并知道它们在整数和实数操作数上的行为。

OperatorMeaningPseudocode examplePython equivalent
+Addition | 加3 + 2 = 53 + 2 = 5
-Subtraction | 减7 - 4 = 37 - 4 = 3
*Multiplication | 乘6 * 4 = 246 * 4 = 24
/Real division | 实数除法7 / 2 = 3.57 / 2 = 3.5
DIVInteger division | 整除17 DIV 5 = 317 // 5 = 3
MODRemainder | 取余17 MOD 5 = 217 % 5 = 2
^Exponent | 幂23 = 82 ** 3 = 8

both contexts, multiplication and division are evaluated before addition and subtraction unless parentheses change the order.

请注意,Edexcel伪代码使用^表示幂,而Python使用**。在两种环境中,乘法和除法都先于加法和减法求值,除非括号改变顺序。


3. DIV and MOD | 整除与取余

DIV gives the whole-number quotient when one integer is divided by another, and MOD gives the remainder. These operations are extremely common in algorithm questions involving digits, cycles, calendars and validation rules.

DIV给出一个整数除以另一个整数时的整数商,MOD给出余数。这些运算在涉及数字、周期、日历和验证规则的算法题中非常常见。

17 DIV 5 = 3    17 MOD 5 = 2

In Python the same results are produced by // and %: 17 // 5 gives 3 and 17 % 5 gives 2. For positive integers this is straightforward, and most exam examples use positive values.

在Python中,同样的结果由//和%产生:17 // 5得到3,17 % 5得到2。对于正整数,这很简单,大多数考试示例都使用正值。


广告 / Sponsored

4. Relational and Comparison Operators | 关系与比较运算符

Relational operators compare two values and return a Boolean result: TRUE or FALSE. They are used in IF statements, WHILE loops and validation checks.

关系运算符比较两个值并返回布尔结果:TRUE或FALSE。它们用于IF语句、WHILE循环和验证检查中。

OperatorMeaningExample
==Equal to | 等于5 == 5 evaluates to TRUE
!=Not equal to | 不等于5 != 4 evaluates to TRUE
<Less than | 小于3 < 8 evaluates to TRUE
>Greater than | 大于10 > 4 evaluates to TRUE
&lt;=Less than or equal to | 小于等于6 &lt;= 6 evaluates to TRUE
&gt;=Greater than or equal to | 大于等于9 &gt;= 8 evaluates to TRUE

quality. Using = where == is required will usually cause an error or unexpected behaviour.

一个关键的考试易错点是将=和==混淆。在Edexcel伪代码和Python中,单个=用于赋值,而==用于比较相等。在需要==的地方使用=通常会导致错误或意外行为。


5. Boolean and Logical Operators | 布尔与逻辑运算符

Boolean operators AND, OR and NOT combine or invert Boolean conditions. They are essential for constructing compound conditions in IF, WHILE and REPEAT structures.

布尔运算符AND、OR和NOT用于组合或反转布尔条件。它们在构建IF、WHILE和REPEAT结构中的复合条件时必不可少。

ABA AND BA OR BNOT A
TRUETRUETRUETRUEFALSE
TRUEFALSEFALSETRUEFALSE
FALSETRUEFALSETRUETRUEPublished by TutorHao | A-Level 编程 Revision Series | aleveler.com

广告 / Sponsored
神舟(HASEE)【 RTX5070】战神S9 13代酷睿i7 15.6英寸游戏本笔记本电脑(i7-13620H 16…
学习备考用品 · 正版现货 · 学习备考通用
查看详情 / View on Taobao
广告 / Sponsored
Lenovo/联想 TB335FC 联想平板小新平板11 2025款 11英寸2.5K 小新pad联想平板电脑
学习备考用品 · 正版现货 · 学习备考通用
查看详情 / View on Taobao

更多咨询请联系16621398022(同微信)

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao