Codesters
Loops
Conditionals
Data Types
Very Difficult
100

The line of code to create a "person1" sprite named sprite

sprite = codesters.Sprite("person1") 

100
The lines of code that create a loop with a range of 5.

for counter in range(5):

   pass

100

The line of code which tests whether the variable "choice" is equal to True

if choice == True:

100

The line of code that creates a string variable named var with the text as "Easy Peasy"

var = "Easy Peasy"

100
What is the line of code to disable a mouse move event?

stage.event_mouse_move(None)

200

The line of code to change the size of the sprite named sprite to ".5"

sprite.set_size(.5)

200

The line of code which creates a loop printing each element of a list named "my_list"

for value in my_list:

   print(value)


200

The lines of code that are used to create an if else statement comparing x to 10.

if x == 10:

   //code

else:

   //code

200
The line of code that creates an random Integer variable "x" between 0 and 100.

x = random.randint(0,100)

200

The line of code to create an empty dictionary named "my_dictionary"

my_dictionary = {}

300

The line of code to create a "person1" sprite named sprite on a random x and y position (-250 to 250 for each)

sprite = codesters.Sprite("person1", random.randint(-250,250), random.randint(-250,250))

300

The key word for ending a loop early

what is a break?

300

The lines of code to make an if statement for x = 10 and y = 10. If it is True, print "Both are ten" to the console 

if x == 10 and y == 10:

   print("Both are ten")

300

The line of code which creates a boolean variable "boo" with the value of False.

boo = False

300
The key symbol to create a comment

What is a #?

400

The line of code to pause the stage for two seconds

stage.wait(2)

400

The line of code which creates an infinite loop (2x POINTS!!)

while True:

400
The line of code which tests for whether x = 10, x = 5, and anything else. If x = 10, print the number to the console. If x = 5, print the number to the console. If it is anything else, print it to the console.

if x == 10:

   print(x)

elif x == 5:

   print(x)

else:

   print(x)

400

The key word to use a variable created outside a loop to now use it inside the loop.

What is global?

400

The line of code that "catchs" a generic error and stores the error message in the variable e.

except Exception as e:

500

The line of code to give a sprite named sprite an attribute. Name the attribute "is_alive" and set it to True.

sprite.is_alive = True

500

The line of code that creates a loop that continues while my_var is equal to the string "hello"

while my_var == "hello":

500

The line of code which compares the boolean variables x, y, and z. x needs to be True. Of y and z, one of them need to be True. Use the expression in an "if" statement to print out "Tough Question"

if x and (y or z):

   print("Tough Question")

500

The line of code to convert a string into a list. List name is my_list and String name is str.

my_list = list(str)

500

The line of code which prints a random float integer between 0 and 1

print(random.random())