3.3.1–3.3.2
Arithmetic and comparison operators (3.3.1–3.3.2) is a Class 10 Computer Science lesson for the Punjab boards. It walks through the idea in plain steps, then sets a short check, in English, Urdu or Roman Urdu.
Your guide: Miss HiraExplains computers with chai, cricket and your phone.
Chapter 1 of every subject is free. Unlock every chapter of this class with the full course.
Unlock full courseAlready paid? Sign in with the Google account you paid with.
An operator acts on operands; an expression combines them to give a value. Arithmetic operators: + − * / (true division), // (floor division), % (remainder) and ** (power).
Take a = 10 and b = 3. Then a + b = 13 and a * b = 30. Also a / b = 3.333…, a // b = 3, a % b = 1 and a ** b = 1000.
Comparison operators > < == != >= <= compare two values and return True or False. With x = 10, y = 5: x > y is True, x == y is False, x != y is True.
Step 1 / 1
An operator acts on operands; an expression combines them to give a value. Arithmetic operators: + − * / (true division), // (floor division), % (remainder) and ** (power).
Take a = 10 and b = 3. Then a + b = 13 and a * b = 30. Also a / b = 3.333…, a // b = 3, a % b = 1 and a ** b = 1000.
Comparison operators > < == != >= <= compare two values and return True or False. With x = 10, y = 5: x > y is True, x == y is False, x != y is True.
/ always gives a float; // drops the fraction; % gives the remainder.
Found a mistake? Tell us the lesson and the line at exciting@boringeducation.com.
No ads. Tell us what to fix.