Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
Give this quiz to my class
Q 1/10
Score 0
What is the output of the following Python code?
x = 5
y = 3
print(f'The sum of {x} and {y} is {x + y}.
The product is {x * y}.')
30
The sum of 5 and 3 is 8.
The product is 15.
The sum of 5 and 3 is 15.
The product is 8.
The sum of 5 and 3 is 8.
The product is 5.
The sum of 5 and 3 is 8.
The product is 3.
Q 2/10
Score 0
If you have the following Python code:
p = 4
q = 2
result = p ** q
print(f'The value of {p} raised to the power of {q} is {result}.')
30
The value of 4 raised to the power of 2 is 4.
The value of 4 raised to the power of 2 is 6.
The value of 4 raised to the power of 2 is 16.
The value of 4 raised to the power of 2 is 8.
10 questions
Q.
What is the output of the following Python code?
x = 5
y = 3
print(f'The sum of {x} and {y} is {x + y}.
The product is {x * y}.')
1
30 sec
Q.
If you have the following Python code:
p = 4
q = 2
result = p ** q
print(f'The value of {p} raised to the power of {q} is {result}.')
2
30 sec
Q.
Consider the following Python code:
radius = 3
area = 3.14 * radius ** 2
print(f'The area of a circle with radius {radius} is approximately {area}.')
3
30 sec
Q.
What will be the output of the following Python code?
a = 10
b = 5
print(f'The difference between {a} and {b} is {a - b}.
The division result is {a / b}.')
4
30 sec
Q.
Given this Python code:
length = 8
width = 4
perimeter = 2 * (length + width)
print(f'The perimeter of a rectangle with length {length} and width {width} is {perimeter}.')
5
30 sec
Q.
What is the output of the following Python code?
num1 = 6
num2 = 3
result = num1 % num2
print(f'The remainder when {num1} is divided by {num2} is {result}.')
6
30 sec
Q.
Consider the following Python code:
base = 5
exponent = 3
power_result = base ** exponent
print(f'The result of {base} raised to the power of {exponent} is {power_result}.')
7
30 sec
Q.
What will be the output of the following Python code?
price = 50
tax = 0.2
total_price = price + (price * tax)
print(f'The total price after tax on an item priced at {price} is {total_price}.')
8
30 sec
Q.
If you execute the following Python code:
x = 12
y = 4
average = (x + y) / 2
print(f'The average of {x} and {y} is {average}.')
9
30 sec
Q.
What will be the output of the following Python code?
principal = 1000
rate = 0.05
time = 3
interest = principal * rate * time
print(f'The simple interest earned on {principal} at a rate of {rate * 100}% over {time} years is {interest}.')