Quiz on List and Tuples

Quiz on List and Tuples

University

16 Qs

quiz-placeholder

Similar activities

L1 - Computer Networks

L1 - Computer Networks

University

13 Qs

Java Control and Loop -2

Java Control and Loop -2

University

20 Qs

Five Nights At Freddy's: Security Breach Quiz

Five Nights At Freddy's: Security Breach Quiz

KG - Professional Development

13 Qs

Lenguaje de Definición de Datos

Lenguaje de Definición de Datos

University

18 Qs

Intro to Data Mining

Intro to Data Mining

University

15 Qs

PBO Inheritance Episode 2

PBO Inheritance Episode 2

University

18 Qs

Logika & Pemrograman (ID)

Logika & Pemrograman (ID)

10th Grade - Professional Development

20 Qs

Porcentajes

Porcentajes

University

12 Qs

Quiz on List and Tuples

Quiz on List and Tuples

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

spandan gunti

Used 26+ times

FREE Resource

AI

Enhance your content in a minute

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

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

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

print(a[::2])

[1,2]

[8,9]

[1,3,5,7,9]

[1,2,3]

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What will be the output of the following code snippet?

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

a[::2]=10,20,30,40,50,60

print(a)

ValueError: attempt to assign sequence of size 6 to extended slice of size 5

[10, 2, 20, 4, 30, 6, 40, 8, 50, 60]

[1, 2, 10, 20, 30, 40, 50, 60]

[1, 10, 3, 20, 5, 30, 7, 40, 9, 50, 60]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

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())

1 2 3 4

1 4 8 12

4 7 11 15

12,13,14,15

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the output of the following code snippet?

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

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

Syntax error

[4, 3, 2]

[4, 3]

[4, 3, 2, 1]

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following list

l1=[1,2,3]

L1 = [1,2,3]+[4,5,6]

what is L1

[1,2,3,5,7,9]

[1,2,3]

[4,5,6]

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

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Python, list is mutable

True

False

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these pieces of code would return the name "Harry" from the following list?

nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]

nameList()

nameList[1]

NameList(4)

nameList["4"]

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?