NEW
Font size
Worksheetsgrade 7,8 week 4
Total questions: 53
Worksheet time: 9hrs 50mins
What is an operator in programming?
A device to run programs
A tool to solve math
A symbol to perform an operation
A name for functions
Which of the following is an arithmetic operator?
==
and
+
!=
What does the operator == mean?
Assignment
Equal to
Not equal
Addition
Which operator is used to assign a value to a variable?
==
=
:=
+=
What is the main purpose of logical operators?
To create variables
To perform math
To combine conditions
To call functions
Which of these is a comparison operator?
+
or
!=
**
What does the operator != represent?
Less than
Not equal
Assignment
Greater than
What does the operator and do?
Returns True if both conditions are true
Returns False always
Adds numbers
Compares strings
What does the operator or do?
Returns True only if both conditions are false
Returns True if at least one condition is true
Compares numbers
Always returns False
What does not do in Boolean logic?
Repeats a loop
Makes a value zero
Reverses the truth value
Multiplies a value
What is the result of 5 + 3?
7
8
9
6
What is the result of 10 - 6?
5
6
4
3
What is the result of 4 * 2?
8
6
4
2
What is the result of 12 / 4?
3
2
4
5
What does 10 % 3 return?
1
2
3
0
What does 2 ** 3 return?
6
8
9
5
Which operator gives only the whole number result of a division?
/
//
%
*
What is the output of 7 // 2?
3.5
3
2
4
What does the * operator do?
Division
Addition
Multiplication
Comparison
What is the result of 9 % 2?
0
2
1
3
What does 5 == 5 return?
False
True
Error
0
What is the output of 7 != 3?
False
True
0
None
What does 6 > 2 return?
True
False
Error
None
What does 3 < 1 return?
True
False
1
0
What is the result of 4 >= 4?
True
False
None
0
What is the result of 2 <= 1?
True
False
Error
1
Which operator is used for "greater than"?
>
<
>=
==
>= 4?
True
False
None
0
What is the result of 2 <= 1?
True
False
Error
1
Which operator is used for "greater than"?
>
<
>=
==
What does == compare?
Data type
Object type
Values
Memory address
Which operator checks "less than or equal to"?
<=
<
==
>=
What does 5 != 5 return?
True
False
5
None
What does x = 10 mean?
x is added 10
x becomes 10
x is deleted
10 becomes x
What does x += 2 mean?
x = x + 2
x = x - 2
x = 2
x * 2
What does x -= 1 mean?
x = x - 1
x = x + 1
x = 1
x = x / 1
What does x *= 3 mean?
x = x * 3
x = x + 3
x = 3
x = x - 3
What does x /= 2 do?
x = x / 2
x = 2 / x
x = x * 2
x = 2
Which operator is used for assigning values?
==
=
:=
=>
What happens with x = x + 1?
x increases by 1
x becomes 0
x is divided
x stays the same
What is another way to write x = x + 1?
x++
x += 1
x =+ 1
+x = 1
What is x = x * 2 used for?
Doubling x
Halving x
Squaring x
Making x zero
What does x = x - 5 do?
Adds 5
Subtracts 5
Multiplies by 5
Divides by 5
What is the result of True and True?
True
False
None
1
What is the result of True and False?
False
True
None
Error
What is the result of True or False?
True
False
None
Error
What is the result of False or False?
True
False
Error
None
What is not True?
False
True
None
0
What is not False?
False
True
Error
None
Which condition returns False?
True and True
True or False
False and True
not False
Which condition returns True?
not True
False and False
True or False
False or False
Which of the following uses both logical and comparison operators?
3 + 2
x = 5
5 > 3 and 4 < 6
4 % 2
Why are logical operators useful?
To make decisions
To add numbers
To print messages
To create strings
