wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

grade 7,8 week 4

Total questions: 53

Worksheet time: 9hrs 50mins

Name
Class
Date
1.

What is an operator in programming?

a)

A device to run programs

b)

A tool to solve math

c)

A symbol to perform an operation

d)

A name for functions

2.

Which of the following is an arithmetic operator?

a)

==

b)

and

c)

+

d)

!=

3.

What does the operator == mean?

a)

Assignment

b)

Equal to

c)

Not equal

d)

Addition

4.

Which operator is used to assign a value to a variable?

a)

==

b)

=

c)

:=

d)

+=

5.

What is the main purpose of logical operators?

a)

To create variables

b)

To perform math

c)

To combine conditions

d)

To call functions

6.

Which of these is a comparison operator?

a)

+

b)

or

c)

!=

d)

**

7.

What does the operator != represent?

a)

Less than

b)

Not equal

c)

Assignment

d)

Greater than

8.

What does the operator and do?

a)

Returns True if both conditions are true

b)

Returns False always

c)

Adds numbers

d)

Compares strings

9.

What does the operator or do?

a)

Returns True only if both conditions are false

b)

Returns True if at least one condition is true

c)

Compares numbers

d)

Always returns False

10.

What does not do in Boolean logic?

a)

Repeats a loop

b)

Makes a value zero

c)

Reverses the truth value

d)

Multiplies a value

11.

What is the result of 5 + 3?

a)

7

b)

8

c)

9

d)

6

12.

What is the result of 10 - 6?

a)

5

b)

6

c)

4

d)

3

13.

What is the result of 4 * 2?

a)

8

b)

6

c)

4

d)

2

14.

What is the result of 12 / 4?

a)

3

b)

2

c)

4

d)

5

15.

What does 10 % 3 return?

a)

1

b)

2

c)

3

d)

0

16.

What does 2 ** 3 return?

a)

6

b)

8

c)

9

d)

5

17.

Which operator gives only the whole number result of a division?

a)

/

b)

//

c)

%

d)

*

18.

What is the output of 7 // 2?

a)

3.5

b)

3

c)

2

d)

4

19.

What does the * operator do?

a)

Division

b)

Addition

c)

Multiplication

d)

Comparison

20.

What is the result of 9 % 2?

a)

0

b)

2

c)

1

d)

3

21.

What does 5 == 5 return?

a)

False

b)

True

c)

Error

d)

0

22.

What is the output of 7 != 3?

a)

False

b)

True

c)

0

d)

None

23.

What does 6 > 2 return?

a)

True

b)

False

c)

Error

d)

None

24.

What does 3 < 1 return?

a)

True

b)

False

c)

1

d)

0

25.

What is the result of 4 >= 4?

a)

True

b)

False

c)

None

d)

0

26.

What is the result of 2 <= 1?

a)

True

b)

False

c)

Error

d)

1

27.

Which operator is used for "greater than"?

a)

>

b)

<

c)

>=

d)

==

28.

>= 4?

a)

True

b)

False

c)

None

d)

0

29.

What is the result of 2 <= 1?

a)

True

b)

False

c)

Error

d)

1

30.

Which operator is used for "greater than"?

a)

>

b)

<

c)

>=

d)

==

31.

What does == compare?

a)

Data type

b)

Object type

c)

Values

d)

Memory address

32.

Which operator checks "less than or equal to"?

a)

<=

b)

<

c)

==

d)

>=

33.

What does 5 != 5 return?

a)

True

b)

False

c)

5

d)

None

34.

What does x = 10 mean?

a)

x is added 10

b)

x becomes 10

c)

x is deleted

d)

10 becomes x

35.

What does x += 2 mean?

a)

x = x + 2

b)

x = x - 2

c)

x = 2

d)

x * 2

36.

What does x -= 1 mean?

a)

x = x - 1

b)

x = x + 1

c)

x = 1

d)

x = x / 1

37.

What does x *= 3 mean?

a)

x = x * 3

b)

x = x + 3

c)

x = 3

d)

x = x - 3

38.

What does x /= 2 do?

a)

x = x / 2

b)

x = 2 / x

c)

x = x * 2

d)

x = 2

39.

Which operator is used for assigning values?

a)

==

b)

=

c)

:=

d)

=>

40.

What happens with x = x + 1?

a)

x increases by 1

b)

x becomes 0

c)

x is divided

d)

x stays the same

41.

What is another way to write x = x + 1?

a)

x++

b)

x += 1

c)

x =+ 1

d)

+x = 1

42.

What is x = x * 2 used for?

a)

Doubling x

b)

Halving x

c)

Squaring x

d)

Making x zero

43.

What does x = x - 5 do?

a)

Adds 5

b)

Subtracts 5

c)

Multiplies by 5

d)

Divides by 5

44.

What is the result of True and True?

a)

True

b)

False

c)

None

d)

1

45.

What is the result of True and False?

a)

False

b)

True

c)

None

d)

Error

46.

What is the result of True or False?

a)

True

b)

False

c)

None

d)

Error

47.

What is the result of False or False?

a)

True

b)

False

c)

Error

d)

None

48.

What is not True?

a)

False

b)

True

c)

None

d)

0

49.

What is not False?

a)

False

b)

True

c)

Error

d)

None

50.

Which condition returns False?

a)

True and True

b)

True or False

c)

False and True

d)

not False

51.

Which condition returns True?

a)

not True

b)

False and False

c)

True or False

d)

False or False

52.

Which of the following uses both logical and comparison operators?

a)

3 + 2

b)

x = 5

c)

5 > 3 and 4 < 6

d)

4 % 2

53.

Why are logical operators useful?

a)

To make decisions

b)

To add numbers

c)

To print messages

d)

To create strings