No student devices needed. Know more
20 questions
What is the output?
x = -2
y = 3
print (x + y * 2)
2
4
-1
-8
What is output by the following?
print (6 % 8)
.75
8
6
3/4
What is output by the following?
print (10% 3)
0
1
2
3
What is output by the following?
print (3 % 12)
4
1/4
3
.25
What is the output?
x = 5
x = x * 3
print (x)
8
x
error
15
Which of the following correctly stores 45 squared in the variable x?
x = 45 ^ 45
x = 45 ** 2
x = 45 * 2
x = 45 ** 45
What is the output?
x = 9
y = -3
z = 2
print(x + y * z)
3
15
-25
12
Which of the following is the Base and Exponent?
3 * 5 + 4 ** 2 - 1
Base: 3, Exponent: 5
Base: 4, Exponent: 2
Base: 5, Exponent: 3
Base: 2, Exponent: 4
What is wrong with the following code?
There may be more than one answer.
n1 = input("Enter a number: ")
n2 = input("Enter a number: ")
n3 = input("Enter a number: ")
print ("The average is: " + str( n1 + n2 + n3 /3))
It is missing ( ) in the last line to correctly calculate the average.
There should be a float function on the input commands.
It is missing a pow in the last line to correctly calculate the average.
Nothing, it correctly finds the average of the numbers.
What function is used to find the absolute value of a number?
sqrt()
pow()
fabs()
randint()
What function is used to find the square root of a number?
fabs()
randint()
pow()
sqrt()
A ____________ is a collection of code and functions that perform similar tasks
import
module
program
algorithm
The ____________ command pulls in code to add functions to programs.
random
simpleplot
import
str()
The values for colors in an RGB command range from ______ to _____.
1, 256
0, 100
-256, 256
0, 255
What does RGB stand for?
Red Green Blue
Random Graphic Base
Really Good Beats
not listed
To input a decimal you need the ____________ function.
float
int
str
val
Big Data is measured in _______________.
gigabytes
terabytes
megabytes
kilobytes
When do you NOT use a String?
To store a word.
To store decimal values.
To store values NOT used for calculations.
To store color values.
Why do we do number calculations in programming?
Because computers are used to store data.
Because computers can do calculations humans can't.
Because the values stored in variables cannot change.
Programming is an important skill.
Which of the following calculates to 12?
(3 * 6 + 2) /2
(3 * 6) + 2 /2
3 * ((6 + 2) /2)
3 * 6 + 2 /2
Explore all questions with a free account