Python List

Python List

University

10 Qs

quiz-placeholder

Similar activities

Tree and Planar Graph

Tree and Planar Graph

University

10 Qs

Computational Thinking in Python[Quiz 3]

Computational Thinking in Python[Quiz 3]

University

15 Qs

TOOLS FOR AD & TECHNOLOGY DEVELOPMENT (W4-W6)

TOOLS FOR AD & TECHNOLOGY DEVELOPMENT (W4-W6)

University

10 Qs

CC103 - Seatwork 1

CC103 - Seatwork 1

University

15 Qs

SQL JOINS

SQL JOINS

University

10 Qs

BB

BB

University

10 Qs

Redes Vlan

Redes Vlan

University

15 Qs

Python List

Python List

Assessment

Quiz

Computers

University

Hard

Created by

Ronjie Malinao

Used 843+ 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

30 sec • 1 pt

Which of these is the correct code for creating a list of names?

nameList = John, Harry, Jesse, John, Harry, Harry

nameList = ("John", "Harry", "Jesse", "John", "Harry", "Harry")

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

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

2.

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"]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The list needs one more name added to the end - "Felipe". Which piece of code below would do this?

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

nameList.append(Felipe)

append(nameList,"Felipe")

nameList.append["Felipe",7]

nameList.append("Felipe")

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

The list will be slice and show Harry and Jesse only. Which piece of code below would do this?

print(nameList[1:3])

print(nameList[0:1])

print(nameList[1:2])

print(nameList["Harry":"Jesse"])

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

To insert an the string "Pedro" in the first position of a the nameList we use

nameList.append("Pedro, 1")

nameList.insert("Pedro",0)

nameList.insert(1, "Pedro")

nameList.insert(0, "Pedro")

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

variable.sort() will do what?

Sort the list into alphabetical order

Sort the list into reverse order

Create a new list

Error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the function of the reverse method for lists?

removes the first occurrence of the information inside the parenthesis

adds the information inside the parenthesis to the end of the list

reverses the order of the elements inside a list

sorts the list (lowest to highest for numbers and alphabetical order for strings)

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

Already have an account?