wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

G7B_Quiz1_2T

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.
This operator means that one value is the same as the other value
a)
==
b)
!=
c)
>
d)
<
2.

The result of this program:

Friday = False

if Friday:

print "Jeans day!"

else:

print "Uniform day"

a)

Jeans day

b)

Today is Friday

c)

Uniform day

d)

Not Friday

3.

What is the output?

a)

condition

b)

True

c)

Program has a syntax error.

d)

3 > 2

4.

What is the output?

a)

True

b)

False

c)

condition1

d)

condition2

5.

In Python, what are if-statements used for?

a)

Looping

b)

Indexing

c)

Decision Making

d)

Testing

6.

What is the output of this code?


click = True

Like = 0

if click:

Like = Like + 1

print(Like)

a)

0

b)

1

c)

2

d)

3

7.

What is the output of the following code?


What is the output of following code

Temperature = 20

Thermo = 15

if Temperature < 15:

Thermo = Thermo + 5

print(Thermo)

a)

20

b)

15

c)

25

d)

10

8.

What is the output of the following code?


Time = "Day"

Sleepy = False

Pajamas = "Off"

if Time == "Night" and Sleepy == True:

Pajamas = "On"

print(Pajamas)

a)

off

b)

on

c)

False

d)

Day

9.

What will the be the output of the following code?


if (10<0) and (0 <-10):

print(“A”)

else:

print(“B”)

a)

A

b)

B

c)

AB

d)

BA

10.

What is the output of the following code?


a = "b"

if True or True:

a = "a"

print(a * 2)

a)

bb

b)

aa

c)

ab

d)

ba

11.

What would be outputted here?

a)

it divides by 7!

b)

it divides by 3!

c)

It divides by 7.

d)

It divides by 3.

12.

What will be outputted?

a)

number is bigger than 10

b)

nothing

c)

an error

d)

NUMBER IS BIGGER THAN 10

13.

Which condition is a logic error (will not run properly)?

a)

x>=1 AND x<=100

b)

1<=x<=100

c)

1>x>100

d)

x<1 OR x>100

14.

// remainder of the division (%)

num = 8

if num%2 == 0:

print("the number is even")

else :

print("the number is odd")

a)

even

b)

the number is even

c)

the number is odd

d)

None

15.

The result of this program:

Friday = true

if Friday:

print "Jeans day!"

else:

print "Uniform day"

a)

Jeans day

b)

Today is Friday

c)

Uniform day

d)

Not Friday