str1 = "apple"
str2 = str1
str2 += "s"
print(str1)
What would the code above have as an output?
1045 week 7 (Transforming Sequences (Mutability & Memory))
Quiz
•
Fun, Computers
•
University
•
Medium
Ajay Kanagendran
Used 8+ times
FREE Resource
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
str1 = "apple"
str2 = str1
str2 += "s"
print(str1)
What would the code above have as an output?
apple
apples
s
str1
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Related to previous question:
Why was the output "apple"?
Python string are mutable
Python string are immutable
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do we use shallow/deepcopy?
We just call the respective functions
Depends on my computer
Import then call the respective functions
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
lst1 = [1, 2, 3]
lst2 = [2, 4, 6]
lst2[2] = [5]
print(lst1)
What's the output of this code?
[1,2,3]
[1,5,3]
[1,2,5]
[2,4,6]
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
lst1 = [1, 2, 3]
lst2 = lst1
lst2[1] = 9
print(lst1)
What is the output of the code above?
[1,2,3]
[1,2,9]
[9,2,3]
[1,9,3]
10 questions
MS Excel - Day 04
Quiz
•
University
8 questions
Python String Slicing
Quiz
•
University
10 questions
Java Quiz 1
Quiz
•
University
10 questions
Python Basics
Quiz
•
12th Grade - University
10 questions
Basics of C
Quiz
•
University
10 questions
Functions - C
Quiz
•
12th Grade - University
10 questions
C Programming Quiz-5
Quiz
•
University
10 questions
Post Test #3 - Python Fundamental #2
Quiz
•
University
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