wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Programming - What Do I Know?

Total questions: 15

Worksheet time: 15mins

Name
Class
Date
1.

What is a variable for?

a)

Holding information

b)

Checking a condition

c)

Adding some text

d)

Changing the code

2.

What is syntax?

a)

The text editor we use to write code

b)

The rules we follow when we write code so the computer can understand it.

c)

The way we type so we can get the code written quickly.

d)

How long the computer thinks before it can write a new line of code.

3.

How would I finish this line of code to accept input from a user?

myAge = .......

a)

input("What is your age?")

b)

13

c)

input(int("What is your age?"))

d)

int(input("What is your age?"))

4.

Why do we comment code?

a)

To look good

b)

To tell other people what our code means in plain English

c)

To help the computer understand what we want the code to do.

d)

The computer reads it and can help fill in information.

5.

What is the missing word in this code?

a)

input

b)

int

c)

print

d)

"Your name"

6.

What does the symbol ">=" mean in an if statement?

a)

Less than or equal to

b)

Less than

c)

Greater than

d)

Greater than or equal to

7.

What would the above code print?

a)

Your first name is not John but it is Smith

b)

Your first name is not, Smith, but it is, John

c)

Your first name is not lastName but it is name

d)

Your first name is not Smith but it is John

8.

What would the above code print out?

a)

You are a giant!

b)

You are a normal height

c)

Oh no, are you shrinking?

d)

Nothing

9.

A diagrammatic representation of an algorithm is called a...

a)

code chart

b)

code diagram

c)

flowchart

d)

algorithm chart

10.

Which line of code has an error that would stop it from running

a)

1

b)

3

c)

5

d)

6

11.

True or false:

!= is a valid operator in an if statement.

a)

True

b)

False

12.

What would the code print out?

a)

5

b)

3 + 2

c)

32

d)

Error

13.

What range of numbers would the code print out?

a)

20-30

b)

20-31

c)

20-29

d)

0-30

14.

What would the code above print out?

a)

Sedan

b)

4x4

c)

Hatch

d)

Sports

15.

What could the for loop print out?

a)

You can afford Halogen

You can afford LED

You can afford Fancy

b)

You can afford Halogen, LED, Fancy

c)

You can afford Halogen

You can afford LED

d)

None of the above.