wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

PC1.8 Evaluate computer program

Total questions: 10

Worksheet time: 20mins

Name
Class
Date
1.

How many variables in the codes below?

score=int(input("Enter the score? "))

a=200

total=a+100


a)

1

b)

2

c)

3

d)

4

2.

What is the data type in the score's variable?

score=int(input("Enter the score? "))

a)

Integer

b)

Float

c)

Character

d)

String

3.

What is the data type in the score's variable?

score=input("Enter the score? ")

a)

Integer

b)

Float

c)

Character

d)

String

4.

What is the output in the codes below?

a=10

b=20

print(a!=b)

a)

10

b)

False

c)

True

d)

20

5.

if total>=50 :

print("A")

else :

print("B")

Will the code inside the if block is executed or skipped when total = 50?

a)

(if block) will not be executed, then print "B"

b)

(if block) will be executed, then print "A"

c)

(if block) will be executed, then print "B"

d)

(if block) will not be executed, then print "A"

6.

The codes below have an error because of :

score=90

if score>100 :

else :

print("B")

a)

No parentheses after if statement

b)

No print function after if statement

c)

No columns

d)

No semicolons

7.

The codes below have an error because of :

if score>100 :

print("A")

else :

print("B")

a)

No indent

b)

No print function

c)

No columns

d)

No variables

8.

The codes below have an error because of :

score==30

if score>100 :

print("A")

else :

print("B")

a)

The arithmetic operator in the variable score

b)

No print function

c)

Relational operator in the variable score

d)

No variables

9.

The codes below have an error because of :

score=150

if score>100

print("A")

else

print("B")

a)

The arithmetic operator in the variable score

b)

No print function

c)

Relational operator in the variable score

d)

No colons

10.

a=100

b=50

print((a>b) and (a==b))

The data type after the codes have been executed will be:

a)

Integer

b)

String

c)

Float

d)

Boolean