Which of the following assignment statements is equivalent to the following code snippet?
coffee, tea, smoothie = ["kona", "mango", "raspberry"]
Python Packing & Unpacking Review
Quiz
•
Computers
•
9th - 12th Grade
•
Easy
Cedra Wilson
Used 104+ times
FREE Resource
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following assignment statements is equivalent to the following code snippet?
coffee, tea, smoothie = ["kona", "mango", "raspberry"]
coffee = "kona"
tea = "mango"
smoothie = "raspberry"
coffee = "raspberry"
tea = "mango"
smoothie = "kona"
coffee = "kona"
tea = "kona"
smoothie = "kona"
coffee = ["kona", "mango", "raspberry"]
tea = ["kona", "mango", "raspberry"]
smoothie = ["kona", "mango", "raspberry"]
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following assignment statements is equivalent to the following code snippet?
red, blue, green = "BLUE", "GREEN", "RED"
red = "RED"
blue = "BLUE"
green = "GREEN"
red = "BLUE"
blue = "GREEN"
green = "RED"
red = ["BLUE", "GREEN", "RED"]
blue = ["BLUE", "GREEN", "RED"]
green = ["BLUE", "GREEN", "RED"]
red = "BLUE"
blue = "BLUE"
green = "BLUE"
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output when this program is executed?
first = 10
second = 20
first, second = second, first
print(first, second)
20 10
10 20
Error
first, second
second, first
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output when this program is executed?
x = 1
y = 2
z = 3
my_list = [x, y, z]
print(my_list)
[1, 2, 3]
[x, y, x]
1
2
3
x
y
z
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output when this program is executed?
x, y, z = 1, 2, 3
print("x: " + str(x))
print("y: " + str(y))
print("z: " + str(z))
x: 1
y: 2
z: 3
1: x
2: y
3: x
1
2
3
x
y
z
ValueError
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output when this program is executed?
my_list = [10, 20, 30]
x, y, z = my_list
print("x: " + str(x))
print("y: " + str(y))
print("z: " + str(z))
x: 10
y: 20
z: 30
10: x
20: y
30: x
10
20
30
x
y
z
ValueError
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output when this program is executed?
my_tuple = (1.0, 2.0, 3.0)
x, y, z = my_tuple
print("x: " + str(x))
print("y: " + str(y))
print("z: " + str(z))
x: 1.0
y: 2.0
z: 3.0
1.0: x
2.0: y
3.0: x
1.0
2.0
3.0
x
y
z
ValueError
10 questions
Unit 1 Post Test: Basic Python
Quiz
•
9th - 12th Grade
12 questions
Python_基礎觀念
Quiz
•
9th Grade
12 questions
Java Strings
Quiz
•
9th - 12th Grade
10 questions
String Methods
Quiz
•
9th - 12th Grade
10 questions
Одновимірні масиви.
Quiz
•
10th Grade
10 questions
Python Variables
Quiz
•
7th - 12th Grade
10 questions
CMYK and RGB
Quiz
•
9th - 12th Grade
10 questions
[TN]TIN10_BAI18_GÓI CÂU HỎI 1
Quiz
•
10th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University