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
Similar Resources on Wayground
10 questions
8 задание

Quiz
•
11th Grade
7 questions
مراجعة الاختبار النهائي-انواع البيانات

Quiz
•
11th Grade
10 questions
Python-Quiz-Basic-Datatypes

Quiz
•
12th Grade - Professi...
10 questions
Programming - Iteration, Basic Programming Constructs & Loop

Quiz
•
2nd - 12th Grade
10 questions
Grade 7 Quiz 5 - Python Data Types

Quiz
•
12th Grade
11 questions
Kuizi 1 - Python

Quiz
•
10th Grade - University
10 questions
Bài 32 - Ôn tập lập trình Python

Quiz
•
10th Grade
10 questions
10 sinf Delphi

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade