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

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

University

5 Qs

quiz-placeholder

Similar activities

Python Quiz - 1

Python Quiz - 1

University

10 Qs

Plot the Code

Plot the Code

University

10 Qs

C Programming Quiz-6

C Programming Quiz-6

University

10 Qs

Quiz 2

Quiz 2

University

10 Qs

PSP Week3

PSP Week3

University

10 Qs

c-languiz

c-languiz

University

10 Qs

C Program Array and strings

C Program Array and strings

University

10 Qs

Refreshing DDP 0

Refreshing DDP 0

University

10 Qs

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

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

Assessment

Quiz

Fun, Computers

University

Medium

Created by

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]