No student devices needed. Know more
22 questions
What is stored in variable c?
10
5
15
50
What value is stored in variable B?
1
2
a
3
What is displayed as a result if the user inputs "Karel" to the program?
What is your name? Karel
Hello
Karel
What is your name? Karel
HelloKarel
What is your name? Karel
Hello Karel
Hello Karel
What will display after running the following code?
Welcome!
¡Hola!
¡Hola!
Bonjour!
Welcome! ¡Hola! ¡Hola! Bonjour!
Welcome!
¡Hola!
Welcome!
Bonjour!
Welcome! ¡Hola! Welcome! Bonjour!
What is displayed as a result if the user inputs “P” to the program?
“Enter a character. ” P
“:” “c” P
Enter a character. P
:
c
P
Enter a character. P
: c P
“Enter a character. ” P
“:” “c” symbol
What will the following code segment evaluate to?
29
56
29.0
56.0
What will the following code segment evaluate to?
1
4
2.5
25
What will the following code segment evaluate to?
0
10
-10
-5
What will c evaluate to in the following code segment?
2
3.4
3
5
Suppose we’ve written a function draw_circle that we want to call every time the mouse is clicked. How can we do this?
add_mouse_click_handler(draw_circle(x, y))
add_mouse_click_handler("draw_circle")
add_mouse_click_handler(draw_circle())
add_mouse_click_handler(draw_circle)
What is a callback function?
A function passed to an event handler that is called every time a certain event happens
A function called at the bottom of the program
A function that is never called
A function called every 20 milliseconds
What are the coordinates of the top right corner of the screen?
0, 0
0, get_width()
get_width(), get_height()
get_width(), 0
In the following code, we create a circle and add it to the screen. What is the meaning of the x and y variables?
The position of the center of the circle.
The position of the bottom left of the circle.
The position of the top left of the circle
The radius of the minor and major axis of the oval.
What does the following Python program print?
9
12
15
21
Which of the following operations will output a value of 5?
11 % 6
11/2
float(11)/2
2 + 3 * 2
What function do you need to call to ask the user of the program to enter text?
input
read
text
To ask the user of the program for a number, which function should you use?
input
int
text
input inside of a int( ) function
What type is the following variable?
x = "Hi there"
float
interger
boolean
string
What does the following Python program print?
I am 6 feet tall
I am6feet tall
I am
6
feet tall
x
y
z
What is the proper keyword to print to the screen?
write
println
output
Which of the following print statements is written correctly?
print “Hello World”
println(“Hello World”)
print(“Hello World”)
print(Hello World)
Which of the following choices is a properly formed Python variable name, meaning it is both legal in the Python language and considered good style?
num_apples
Num_Apples
num_Apples
numApples
Explore all questions with a free account