Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Review Final Python 1st semester

Total questions: 55

Worksheet time: 1hrs 23mins

Name
Class
Date
1.

How do you define(assign) variables?

a)

var="String"

b)

func==Hello

c)

var : 123

d)

word= Hello

2.

Which one does take you to next line?

a)

\t

b)

\n

c)

/n

d)

\\

3.

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

a)

Input

b)

Output

c)

Print

d)

Command

4.

What symbol is used in python to assign values to a variable?

a)

:

b)

*

c)

=

d)

==

5.

What is the end after if statements?

a)

if

b)

Elif

c)

Else

d)

While

6.

A line of text that Python won't try to run as code

a)

Integer

b)

Comment

c)

Strings

d)

Input

7.

A data type than can have one of two values: True or False

a)

Boolean

b)

Basic Calculation

c)

For

d)

While

8.

Data type for a whole number

a)

Float

b)

Boolean

c)

Integer

d)

String

9.

The Boolean operator that returns true if EITHER of its operands are true

a)

and

b)

or

c)

not

d)

equal

10.

// means:

a)

two times division

b)

integer division

c)

exact division with floating number

d)

Put a slash

11.

What does symbol % do?

a)

Integer exact division

b)

Percentage

c)

Division

d)

Remainder

12.

In the following code, what is happening?

foo = "bar"

a)

A variable named foo is being created, with a value of "bar"

b)

A variable named bar is being created, with a value of "foo"

13.

In the following code, what type of variable is being created?

foo = "bar"

a)

Integer

b)

Float

c)

String

14.

In the following code, what type of variable is being created?

foo = 3.5

a)

Integer

b)

Float

c)

String

15.

If foo is equal to 3, what is the value of foo after this operation?


foo /= 3

a)

3

b)

2

c)

1

16.

What do we use variables for?

a)

To store data

b)

Print data

c)

Produce functions

17.

An operator is a symbol of the programming language, which is able to operate on the values.

a)

True

b)

False

18.

What will be the output of :

print(2 ** 3)

a)

8

b)

4

c)

6

d)

Syntax Error

19.

An * (asterisk) sign is exponentiation (power) operator.

a)

True

b)

False

20.

What will be the output of this code:

print(6. / 3.)

a)

2.0

b)

2

c)

63

d)

3

21.

What will be the output of this code:

print(6 // 3)

a)

2.0

b)

2

c)

63

d)

3

22.

What will be the output of this code:

print(-6 // 4)

a)

2.0

b)

-2

c)

4

d)

6

23.

The graphical representation in Python of the operator :Remaider(modulo) is :

a)

%

b)

$

c)

//

d)

**

24.

What will be the output of this code:

print(14 % 4)

a)

14

b)

2

c)

4

d)

3

25.

What does every Python variable have?

a)

A name and a value.

b)

Numbers only,

c)

Description of the itme only.

d)

An operator.

26.

The name of the variable must begin with a letter

a)

True

b)

False

27.

In a Variable the underscore character is considered as letter.

a)

True

b)

False

28.

What can you put inside a variable?

a)

Anything

b)

Only numbers

c)

Strings

d)

Operators

29.

What will be the output of this code:

var = 1

print(var)

a)

14

b)

1

c)

4

d)

3

30.

What will be the output of this code:

var = 5

print(Var)

a)

5

b)

NameError

c)

Var

d)

print(Var)

31.

What will be the output of this code:

var = "3.8.5"

print("Python version: " + var)

a)

Python version: 3.8.5

b)

NameError

c)

Var

d)

3.8.5

32.

integers are...

a)

algebra

b)

your age

c)

whole numbers including negatives

d)

imaginary

33.
a line of text that Python won't try to run as code
a)
comment
b)
modulo
c)
variable
d)
boolean
34.
a data type than can have one of two values: True or False
a)
boolean
b)
variable
c)
modulo
d)
interpreter
35.
A variable that can only have two values, True or False.
a)
Boolean
b)
If
c)
elif
d)
else
36.

Variables may hold...

a)

Strings

b)

Integers

c)

Floats

d)

Booleans

e)

All of the above

37.

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

a)

Arithmetic operators

b)

Comparison operators

38.

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

a)

Arithmetic operators

b)

Comparison operators

39.

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

a)

AND

b)

OR

c)

NOT

d)

>

40.

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

a)

AND

b)

OR

c)

NOT

d)

>

41.

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

a)

AND

b)

OR

c)

NOT

d)

>

42.

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

43.

What is the output of this snippet?

a)

True

b)

False

c)

nothing is printed out

d)

i don't know

44.

What will be the output of the following

a)

0

b)

2

c)

syntax error

d)

32

45.

What will be the output of the following

a)

12

b)

15

c)

syntax error

d)

27

46.

What will be the output of the following

a)

31

b)

240

c)

16

d)

Error

47.

What will be the output of the following

a)

31

b)

8

c)

16

d)

Error

48.

What will be the output of the following

a)

31

b)

128

c)

16

d)

Error

49.

What is the output?

a)

more than 7

b)

more than 23

c)

spam

d)

7

50.

What is the output?

a)

True

b)

False

c)

condition1

d)

condition2

51.

What is the output?

a)

next

stop

b)

next

c)

stop

d)

syntax error - program doesn't work

52.

What is the output?

a)

3

b)

3

7

c)

3

5

7

d)

7

53.

The % symbol in Python is used to.

a)

Get the reminder of a division problem.

b)

Divide the number

c)

Calculate the percentage

d)

Print the output

54.
This operator means that one value is the same as the other value
a)
==
b)
!=
c)
>
d)
<
55.
This operator means that one value is not equal to another value
a)
==
b)
<=
c)
>=
d)
!=