A number that has a decimal or a fraction.
What is a float?
stage.set_background("underwater")
Sets the stage background to the underwater image in the library.
"choice" = sprite.ask("what is your favorite color")
Remove the quotes around choice.
Orange
What is a variable?
choice = sprite.ask("pick a number between 1-20")
At this point, the user's response can be used in a movement command.
False
first it must be cast
choice_num = int(choice)
The act of combining multiple strings and/or variables inside one text display or say command.
What is concatenation?
sam.say("TOO CLOSE!!")
Assigns this say command to the sprite sam.
sprite = codesters.Sprite("person4")
fav_sport = sprite.ask("What's your favorite sport?")
sprite.say("My favorite sport is " fav_sport)
sprite = codesters.Sprite("person4")
fav_sport = sprite.ask("What's your favorite sport?")
sprite.say("My favorite sport is " + fav_sport)
Grey
What is comment code?
square_size = 100
# sprite = codesters.Square(x, y, width, "color")
square1 = codesters.Square(-150, -50, square_size, "red")
# sprite = codesters.Square(x, y, width, "color")
square2 = codesters.Square(-50, 50, square_size, "orange")
# sprite = codesters.Square(x, y, width, "color")
square3 = codesters.Square(50, -50, square_size, "yellow")
# sprite = codesters.Square(x, y, width, "color")
square4 = codesters.Square(150, 50, square_size, "green")
Given this code, the argument for the squares' widths would need to be changed for all four squares individually.
False
Change square_size =
Type of error where the program runs, but does not produce the desired result.
What is a logic error?
sprite.set_size(0.33)
Sets the sprites size to ~one third of its original size.
circle = codesters.Circle(0, 0, 150, my_color)
my_color = "purple"
my_color = "purple"
circle = codesters.Circle(0, 0, 150, my_color)
Green
What is a string?
Functions (click events for example) work even without any code inside them.
False
def click(bear):
sprite.move_up(50)
sprite.move_down(50)
sprite.say("Don't poke me!")
# add other actions...
bear.event_click(click)
Assigns the click event to the sprite with the variable name bear
my_circle = codesters.Circle(0, 100, 90 "cyan")
my_circle = codesters.Circle(0, 100, 90, "cyan")
White
What is dot-notation?
You can find projects from Mr. Barlas and classmates under class projects.
True
These store user responses to ask commands.
What are input variables?
num_integer = int(num)
Casts a variable stored as a string into an integer.
magic_number = random.randint(1,100)
num_display = codesters.Display(my_var, 0, 0)
magic_number = random.randint(1,100)
num_display = codesters.Display(magic_number, 0, 0)
Blue
What is an integer or a float?
Variables ALWAYS appear to the left of the = sign
False