wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Making Decision

Total questions: 9

Worksheet time: 5mins

Name
Class
Date
1.

What is the issue with the following code?

a)

If condition will never be fulfil

b)

print cannot be use multiple times

c)

age is always lesser or equals to 18

d)

Printing conflicting statement,, should have an else statement

2.

What is the issue with the following code?

a)

age 18 should already be an adult

b)

no if statement, compile error SyntaxError

c)

missing elif statement

d)

invalid print statement within else condition

3.

What is the issue with the following code?

a)

SyntaxError, missing " : " at if statement condition

b)

should be elif instead of else

c)

missing condition after else

d)

age is an invalid variable

4.

What is the issue with the following code?

a)

score should be 100 instead of 20

b)

print statement is not a valid function

c)

NameError, age is not definied

d)

age will never be more than or equals to score

5.

What is the issue with the following code?

a)

missing else condition

b)

should use elif instead of else

c)

SyntaxError, we are not allows to use and operator

d)

Logical error, condition "sale > 20 and sale < 20" will never be fulfilled

6.

What is the issue with the following code?

a)

SyntaxError, invalid condition

b)

NameError, variable sale is not defined

c)

Logical error, sale will never be more than 20

d)

Logical error. condition "sale >= 20 or sale <= 20" will always fulfilled

7.

What is the issue with the following code?

a)

LogicalError,

If temperature is 36, it means that there is a heatwave!

b)

SyntaxError,

Cannot use assignment(=) operator in the if condition

c)

NameError, temperature is using the wrong data type

d)

LogicalError,

else condition might not means that it is good weather

8.

What is the issue with the following code?

a)

SyntaxError,

Missing elif statement

b)

NameError,

temperature should be named as temp instead

c)

LogicalError,

The temperate is above 20 degree will always be printed

d)

NameError,

Temperature is spelled wrongly in the last print statement

9.

What is the issue with the following code?

a)

NameError,

True is a reserved word and cannot be use

b)

SyntaxError,

If statement requires a condition rather than True

c)

LogicalError,

Last print statement will always be printed

d)

LogicalError,

The else statement will never be printed