3.3.3–3.3.4
Assignment and logical operators (3.3.3–3.3.4) 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.
= stores the right-hand value in the left-hand variable. Compound operators combine maths with assignment: a += b means a = a + b; likewise -=, *=, /=, //=, %= and **=.
Book trace with a = 10, b = 5: += gives 15, -= gives 10, *= gives 50, /= gives 10.0, //= gives 2.0, %= gives 2.0, **= gives 32.0.
Logical operators combine True/False values: and is True only if both are True; or is True if at least one is True; not flips the value.
Step 1 / 1
= stores the right-hand value in the left-hand variable. Compound operators combine maths with assignment: a += b means a = a + b; likewise -=, *=, /=, //=, %= and **=.
Book trace with a = 10, b = 5: += gives 15, -= gives 10, *= gives 50, /= gives 10.0, //= gives 2.0, %= gives 2.0, **= gives 32.0.
Logical operators combine True/False values: and is True only if both are True; or is True if at least one is True; not flips the value.
and needs both; or needs one; not reverses.
Found a mistake? Tell us the lesson and the line at exciting@boringeducation.com.
No ads. Tell us what to fix.