wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Week 5 - Variables/Booleans

Total questions: 54

Worksheet time: 38mins

Name
Class
Date
1.

What does case sensitive mean?

a)

Prone to static electricity

b)

outcome is based on uppercase and lowercase fonts

c)

a lawyers feelings

d)

what i put my switch in

2.

Which is true about booleans?

a)

they state your age

b)

it is a mixture of cool and beans

c)

it sounds funny

d)

they hold true and false values

3.

integers are...

a)

algebra

b)

your age

c)

whole numbers including negatives

d)

imaginary

4.

a # in Python means the user is trying to...

a)

hashtag

b)

ratio

c)

comment

d)

tic-tac-toe

5.

what is a string in Python?

a)

a long piece of woven material

b)

text, or keyboard characters

c)

something that ties words together

d)

yarn

6.
a line of text that Python won't try to run as code
a)
comment
b)
modulo
c)
variable
d)
boolean
7.
a data type than can have one of two values: True or False
a)
boolean
b)
variable
c)
modulo
d)
interpreter
8.
changing the value of a variable
a)
reassign
b)
comment
c)
modulo
d)
boolean
9.
A variable that can only have two values, True or False.
a)
Boolean
b)
If
c)
elif
d)
else
10.
Which is the correct syntax?
a)
has_dog = true
b)
has_dog = True
c)
has_dog = Treu
d)
HAS_DOG = tRue
11.
This operator means that one value is the same as the other value
a)
==
b)
!=
c)
>
d)
<
12.
What will be the output?
name = 'Dave'
greeting = "Good morning" + name
print (greeting)
a)
Good morning 'Dave'
b)
Good morning Dave
c)
Good morning name
d)
Good morning + Dave
13.
What best defines an IF statement in python?
a)
Is an embedded string with a variable
b)
An IF statement checks to see if a statement is true or false and then does one of two things depending on the result.
14.
How do we make sure that IF statements are indented correctly?
a)
Don't need to
b)
Use the Tab key
c)
Use the Shift Key
d)
Use the Enter Key
15.
In python the ' FLOAT data type' can be defined as...?
a)
holds alphanumerical data
b)
holds whole numbers
c)
holds a decimal point in a number
d)
hold either true or false
16.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
17.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

18.

5. The logical operator for comparing if one value is greater than another is?

a)

>

b)

<

c)

==

19.

6. The logical operator for comparing if one value is less than another is?

a)

>

b)

<

c)

==

20.

Variables may hold...

a)

Strings

b)

Integers

c)

Floats

d)

Booleans

e)

All of the above

21.

+, -, /, * ... these are examples of:

a)

Arithmetic operators

b)

Comparison operators

22.

==, !=, <, > ... these are examples of:

a)

Arithmetic operators

b)

Comparison operators

23.

"These are words!" is a ...

a)

Integers

b)

Floats

c)

Booleans

d)

String

24.

1205 is a ...

a)

Boolean

b)

Float

c)

Integer

d)

String

25.

3.14159 is ...

a)

Pi

b)

A float

c)

An integer

d)

A string

26.

An  algorithm  is a set of precise instructions designed to solve a problem.

a)

True

b)

False

27.

Which of the following is not a Boolean Operator?

a)

AND

b)

OR

c)

NOR

d)

NOT

28.

Which of the following operators requires two conditions to be true?

a)

AND

b)

OR

c)

NOT

d)

>

29.

Which of the following operators requires one condition to be true?

a)

AND

b)

OR

c)

NOT

d)

>

30.

Which of the following operators requires a condition to be false?

a)

AND

b)

OR

c)

NOT

d)

>

31.

What is the Boolean value for True?

a)

0

b)

1

32.

What is the Boolean value for False?

a)

0

b)

1

33.

What is the word (command) used to display numbers and text on the screen?

a)

print

b)

show

c)

output

d)

command

34.

What is the output of this snippet?

a)

True

b)

False

c)

nothing is printed out

d)

i don't know

35.

What is the output of this snippet?

a)

True

b)

False

c)

nothing is printed out

d)

i don't know

36.

What is the output of this snippet?

a)

True

b)

False

c)

nothing is printed out

d)

i don't know

37.

What is the output of this snippet?

a)

True

b)

False

c)

nothing is printed out

d)

i don't know

38.
Which of the following symbols is used in Python to mean "Greater than or equal to"?
a)
<=
b)
>>
c)
>=
d)
=>
39.
Which of the following symbols is used in Python to mean "Less than or equal to"?
a)
<<
b)
=<
c)
<=
d)
!=
40.
Which of the following symbols is used in Python to mean "Not equal to"?
a)
==
b)
!=
c)
<>
d)
><
41.
Which of the following symbols is used in Python to mean "Equal to"?
a)
=
b)
!=
c)
==
d)
>=
42.
Which of the following symbols is used in Python to mean "Less than or equal to"?
a)
<<
b)
=<
c)
<=
d)
!=
43.

Which is NOT a data type in Python?

a)

integer

b)

boolean

c)

anchor

d)

float

44.

What will this symbol do?


\n

a)

Print

b)

Not

c)

New line

d)

Does nothing

45.

What does this symbol represent?


>

a)

Less than

b)

Greater than

c)

Equal to

d)

Less than or equal to

46.

var1 = 1

var2 = 2

var3 = "3"

print(var1 + var2 + var3)

a)

6

b)

33

c)

123

d)

Error. Mixing operators between numbers and strings are not supported.

47.

Which of the following operators requires two conditions to be true?

a)

AND

b)

OR

c)

NOT

d)

>

48.

Which of the following operators requires one condition to be true?

a)

AND

b)

OR

c)

NOT

d)

>

49.

Which of the following operators requires a condition to be false?

a)

AND

b)

OR

c)

NOT

d)

>

50.

Which statement will require girls with brown hair to stand up?

a)

Girl OR Brown Hair

b)

NOT Girl AND Brown Hair

c)

Brown Hair AND Girl

51.

These type of operators are found within equations to perform different types of calculations.

a)

Logic Operators

b)

Arithmetic Operators

c)

Comparison Operators

d)

Boolean Operators

52.

What is this operator: " %"?

a)
Concatenation
b)
Remainder or mod
c)
Division - only the whole number
d)
Escape character
53.

What type of logic gate is this table showing?

a)

AND

b)

OR

c)

NOT

54.
Which programming term means joining two strings together?
a)
Concatenation
b)
Evaluating
c)
Declaring
d)
Initializing