wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Code Combat Review (Python)

Total questions: 10

Worksheet time: 1hrs 16mins

Name
Class
Date
1.

Which line of code is correct?

a)

hero.MoveLeft()

b)

heroMoveLeft();

c)

hero.moveleft(:

d)

hero.moveLeft()

2.

Which line of code will make the hero move up 4 times?

a)

4.hero.Move.Up();

b)

hero.MoveUp(4);

c)

hero.4MoveUp();

d)

hero.Move4Up();

3.

What must every line of code end with?

a)

comma ,

b)

semi-colon ;

c)

parantheses ()

d)

period .

4.

Which line of code will attack Kratt?

a)

hero.attack("Kratt")

b)

hero.attack("kratt");

c)

hero.attack(Kratt);

d)

Hero.Attack.Kratt;

5.

What is the correct way to write a while loop?

a)

while {

b)

while.true {

c)

while (loop)

d)

while True:

6.

How do you create a variable for enemy1 Gert?

a)

enemy1 = "Gert"

b)

enemy1 = Gert

c)

var.enemy1 = Gert;

d)

var.Enemy.1 = "Gert";

7.

You can enter a number as an argument to instruct your object to move more than one space at a time.

a)

True

b)

False

8.

It is not important to capitalize the name of the variables.

a)

True

b)

False

9.

A string will always have quotation marks.

a)

True

b)

False

10.

What is the main reason we use loops?

a)

It saves time

b)

It is faster to create

c)

It is easier to type

d)

To repeat a block of code without having to retype