Python list, if

Quiz
•
Computers
•
6th - 12th Grade
•
Hard
Standards-aligned
Sahana Karunakar
Used 52+ times
FREE Resource
20 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
30 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
nameList = ["John", "Harry", "Jesse", "John", "Marry", "Larry"]
print(nameList.count("John"))
What would be the output
1
2
3
Error
Create a free account and access millions of resources
Similar Resources on Wayground
25 questions
Microsoft Excel

Quiz
•
8th Grade
20 questions
Python Quiz

Quiz
•
8th Grade
20 questions
Unit 5 Quiz - Loops & Lists (code.org)

Quiz
•
10th - 12th Grade
20 questions
Advanced Excel

Quiz
•
KG - University
20 questions
10.1 Data Types and Records Cambridge iAS 9618

Quiz
•
11th Grade
17 questions
JS DOM

Quiz
•
9th - 12th Grade
20 questions
HTML Tags

Quiz
•
6th - 8th Grade
15 questions
Year 12 Programming

Quiz
•
11th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
20 questions
typing

Quiz
•
6th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
20 questions
Input, Output, Processing or Storage

Quiz
•
5th - 6th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade