
KP2-Variables
Authored by MrsT Voci
Arts
2nd Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
36 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
What is the output of the following code?
x = 10
y = 10
z = 0
z = x - y
print(z)
0
20
10
None of these
2.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
What is the output of the following code?
x, y = 10, 20
min = x if x < y else y
print(min)
10
None of these
20
invalid syntax
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
What is the output of the following code?
x = 10
a = 0
print(x > a)
False
True
10
None of these
4.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which of the following casts could result in a run time error?
A string cast as an int
An integer cast as a string
An int cast as a float
A float cast as a string
5.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
What is the value of the variable 'c' in the following code snippet?
a = 3
b = 2
c = a ** b
0
6
False
9
6.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
You are coding a tip calculator. The user must enter a price. Select the line of code that will make your program work whether the user enters whole numbers or decimals (for example, 30.99).
# enter code here
tip_rate = .15
tip = price * tip_rate
total_price = price + tip
price = input(“Enter the price”)
price = int(input(“Enter the price”))
price = float(input(“Enter the price”))
price = flt(input(“Enter the price”))
7.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
What is the purpose of the following code
try:
a = int(b)
except:
print('Error')
None of these
Invalid syntax
Trap an invalid integer value
Convert b to a string
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
31 questions
Desain Grafis & Multimedia
Quiz
•
1st - 12th Grade
40 questions
Solfege Quiz 1.1-1.4
Quiz
•
KG - 8th Grade
32 questions
Aniversario One Direction 12 años
Quiz
•
1st - 12th Grade
34 questions
The Calendar
Quiz
•
1st - 5th Grade
40 questions
professional ethics
Quiz
•
2nd Grade
34 questions
Country Quiz
Quiz
•
2nd Grade
31 questions
Su học kỳ 2
Quiz
•
1st - 5th Grade
40 questions
Review 2
Quiz
•
2nd Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Arts
22 questions
Equal Groups and Arrays
Quiz
•
2nd Grade
10 questions
Life Cycle of a Frog
Quiz
•
1st - 2nd Grade
10 questions
Exploring Rosa Parks and Black History Month
Interactive video
•
1st - 5th Grade
20 questions
Counting Coins
Quiz
•
2nd Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
30 questions
DA Math Mania Bowl - Primary
Quiz
•
2nd Grade
19 questions
Subject-Verb Agreement
Quiz
•
2nd - 5th Grade
10 questions
Harriet Tubman
Quiz
•
2nd - 3rd Grade