wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

JH U1/L4- Kira Conditional Statements

Total questions: 7

Worksheet time: 4mins

Name
Class
Date
1.

Which statement is added when there are two possible outcomes that need handling in addition to an if statement?

a)

while

b)

else

c)

return

d)

import

2.

For the line of code that begins an else block in Platypus, what must be included at the end of that line?

a)

Semicolon

b)

Colon

c)

Closing brace

d)

Quotation mark

3.

How do computer programs treat any line of code that starts with a hashtag symbol (#)?

a)

They execute it first

b)

They ignore it

c)

They convert it to a string

d)

They store it in a log

4.

In the Platypus language, what must appear at the end of an if statement to avoid a syntax error?

a)

A semicolon

b)

An indentation

c)

A colon

d)

A closing parenthesis

5.

According to the Platypus rules, what must happen to the line(s) of code inside an if statement?

a)

They must be commented out

b)

They must be indented

c)

They must be placed in parentheses

d)

They must be preceded by a colon

6.

When there are two possible outcomes to handle in Platypus, which additional construct can be used with an if statement?

a)

switch

b)

while

c)

else

d)

function

7.

How do computer programs treat any line of code that starts with a hashtag symbol (#)?

a)

They execute it before other lines

b)

They store it in memory

c)

They ignore it

d)

They convert it to a string