Search Header Logo

1045 week 7 (Transforming Sequences (Mutability & Memory))

Authored by Ajay Kanagendran

Fun, Computers

University

Used 8+ times

1045 week 7 (Transforming Sequences (Mutability & Memory))
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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]

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?