LIST And Tuple

LIST And Tuple

University

10 Qs

quiz-placeholder

Similar activities

HLT230 Global Health 101 Chapter 1

HLT230 Global Health 101 Chapter 1

University

10 Qs

Tools Data Science

Tools Data Science

University

10 Qs

Quiz ABSS Card File

Quiz ABSS Card File

University

10 Qs

Apollo 11 Boyd E. Smith 101202303

Apollo 11 Boyd E. Smith 101202303

KG - Professional Development

10 Qs

Soil Composition, Types and Structure

Soil Composition, Types and Structure

University

11 Qs

QUIZ BEE

QUIZ BEE

University

10 Qs

Astronomy Quiz Round 2

Astronomy Quiz Round 2

University

7 Qs

Mountain Plants

Mountain Plants

3rd Grade - University

7 Qs

LIST And Tuple

LIST And Tuple

Assessment

Quiz

Science

University

Hard

Created by

Dr. 2669

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

1. What will be the output of the following Python code?

a=[1,2,3,4,5,6,7,8,9]

print(a[::2])

[1, 3, 7, 9]
[1, 3, 5, 7, 9]
[1, 2, 4, 6, 8]
[2, 4, 6, 8]

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

2. What will be the output of the following code snippet?

a=[1,2,3,4,5]

print(a[3:0:-1])

[2, 1]
[3, 2]
[5, 4]
[4, 3]

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

4. The below code is iterating over a nested Python list. What will be the output?

arr = [[1, 2, 3, 4],

[4, 5, 6, 7],

[8, 9, 10, 11],

[12, 13, 14, 15]]

for i in range(0, 4):

print(arr[i].pop())

4, 7, 11, 13
3, 6, 9, 12
1, 4, 8, 12
4, 7, 11, 15

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following statements given below is/are true about a Python tuple?

  • A. Tuples have structure, and lists have an order.

  • B. Tuples are homogeneous, and lists are heterogeneous.

  • C. Tuples are immutable, and lists are mutable.

  • D. All of them.

A&B

B&C

A & C

D&A

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code?

my_list = [1, 2, 3]

my_tuple = tuple(my_list)

print(my_tuple)

(1, 3, 2)
(1, 2, 3)
(2, 1, 3)
(3, 2, 1)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

my_list = [10, 20, 30, 40, 50]

What does my_list[2] return?

20
40
30
15

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the key difference between lists and tuples in Python?

Mutability
Memory consumption
Syntax
Immutability

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?