LIST And Tuple

LIST And Tuple

University

10 Qs

quiz-placeholder

Similar activities

HIPERPROLACTINEMIA - IGW

HIPERPROLACTINEMIA - IGW

University

10 Qs

TEMEL İLK YARDIM

TEMEL İLK YARDIM

University

10 Qs

Sistema Respiratorio

Sistema Respiratorio

University

15 Qs

PENGETAHUAN UMUM

PENGETAHUAN UMUM

University

10 Qs

Chuẩn độ kết tủa

Chuẩn độ kết tủa

University

11 Qs

Ciclo hormonal masculino y femenino

Ciclo hormonal masculino y femenino

10th Grade - University

15 Qs

Quiz Sc and Math

Quiz Sc and Math

University

15 Qs

Preformulasi

Preformulasi

University

10 Qs

LIST And Tuple

LIST And Tuple

Assessment

Quiz

Science

University

Practice Problem

Hard

Created by

Dr. 2669

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

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?

Discover more resources for Science