Computer Science - 4CP0 PearsonEdexcel

Operators

Muhtasari

Every line of working code leans on a small set of operators: symbols that combine values to produce a new one. Add two prices, check whether a score beats a pass mark, decide whether both of two conditions are true at once. Get the wrong operator, or misjudge which one Python evaluates first, and a program runs without crashing while quietly producing the wrong answer.

In this lesson you will learn the six arithmetic operators, including the two that are easy to confuse (integer division and modulus), the six relational operators used to compare values, the three logical operators used to combine conditions, and the order in which Python evaluates a mixed expression. All examples are written in Python, one of the languages available for the Paper 2 practical programming exam.

Malengo

  1. Understand the purpose of, and how to use, arithmetic operators (add, subtract, divide, multiply, modulus, integer division)
  2. Understand the purpose of, and how to use, relational operators (equal to, less than, greater than, not equal to, less than or equal to, greater than or equal to)
  3. Understand the purpose of, and how to use, logic operators (AND, OR, NOT)

Maelezo ya Somo

Python provides six arithmetic operators. Four of them (add, subtract, multiply, divide) are familiar from mathematics. The other two, integer division and modulus, are specific to programming and appear constantly in Paper 2 tasks.

Inapatikana kwenye programu ya Green Bridge

Pakua programu ya Green Bridge CBT kwenye simu yako au kompyuta yako ili kupata maelezo kamili ya masomo, maswali ya mazoezi, na mengi zaidi.

Maelezo kamili ya masomo yenye michoro
Msaidizi wa kujifunza wa AI
Soma bila mtandao, wakati wowote, mahali popote
Inapatikana kwa Android, Windows, macOS, na Linux

Tathmini ya Somo

Hongera kwa kukamilisha somo la Operators. Sasa kwa kuwa umechunguza dhana na mawazo muhimu, ni wakati wa kuweka ujuzi wako kwa mtihani. Sehemu hii inatoa mazoezi mbalimbali maswali yaliyoundwa ili kuimarisha uelewaji wako na kukusaidia kupima ufahamu wako wa nyenzo.

Utakutana na mchanganyiko wa aina mbalimbali za maswali, ikiwemo maswali ya kuchagua jibu sahihi, maswali ya majibu mafupi, na maswali ya insha. Kila swali limebuniwa kwa umakini ili kupima vipengele tofauti vya maarifa yako na ujuzi wa kufikiri kwa makini.

Tumia sehemu hii ya tathmini kama fursa ya kuimarisha uelewa wako wa mada na kubaini maeneo yoyote ambapo unaweza kuhitaji kusoma zaidi. Usikatishwe tamaa na changamoto zozote utakazokutana nazo; badala yake, zitazame kama fursa za kukua na kuboresha.

  1. What is the value of 23 // 5 in Python? A) 3 B) 4 C) 4.6 D) 5 Answer: B
  2. What is the value of 23 % 5 in Python? A) 0 B) 3 C) 4 D) 5 Answer: B
  3. Which operator should be used to compare whether two values are equal in Python? A) = B) == C) != D) <> Answer: B
  4. In the expression 'a and b or c', which operator is applied first? A) and B) or C) They are applied in the order they are written D) It depends on the values of a, b and c Answer: A
  5. A program must only proceed if a number is greater than 0 AND less than 10. Which operator combines these two conditions? A) not B) or C) and D) % Answer: C

Inapatikana kwenye programu ya Green Bridge

Pakua programu ya Green Bridge CBT kwenye simu yako au kompyuta yako ili kupata maelezo kamili ya masomo, maswali ya mazoezi, na mengi zaidi.

Maelezo kamili ya masomo yenye michoro
Msaidizi wa kujifunza wa AI
Soma bila mtandao, wakati wowote, mahali popote
Inapatikana kwa Android, Windows, macOS, na Linux

Inapatikana kwenye programu ya Green Bridge

Pakua programu ya Green Bridge CBT kwenye simu yako au kompyuta yako ili kupata maelezo kamili ya masomo, maswali ya mazoezi, na mengi zaidi.

Maelezo kamili ya masomo yenye michoro
Msaidizi wa kujifunza wa AI
Soma bila mtandao, wakati wowote, mahali popote
Inapatikana kwa Android, Windows, macOS, na Linux

Fanya Mazoezi ya Maswali ya Majaribio

Ungependa kufanya mazoezi ya maswali ya majaribio kuhusu Operators? Pakua programu ya Green Bridge CBT ili kupata maswali ya majaribio na tathmini kamili za mazoezi kuhusu mada hii.

Pakua Programu Kwenye Google Playstore

Kila kitu unachohitaji ili kufaulu katika JAMB, WAEC & NECO.

Green Bridge CBT Mobile App
Msaidizi wa Gumzo wa Kujifunza wa AI Uliobinafsishwa
Maelfu ya Maswali ya Zamani ya IGCSE, JAMB, WAEC & NECO
Zaidi ya Madaftari ya Masomo 1200
Msaada Nje ya Mtandao - Jifunze Wakati Wowote, Popote Pale
Ratiba ya Daraja la Kijani
Muhtasari wa Fasihi na Maswali Yanayoweza Kutokea
Fuata Utendaji na Maendeleo Yako
Maelezo ya Kina kwa Kujifunza kwa Kina