Python list, if

Quiz
•
Computers
•
6th - 12th Grade
•
Hard
Standards-aligned
Sahana Karunakar
Used 51+ 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 Quizizz
25 questions
Algorithms - python (GCSE)

Quiz
•
10th - 12th Grade
16 questions
Python Review

Quiz
•
9th - 12th Grade
20 questions
Int Prog: Lists and Functions

Quiz
•
9th - 12th Grade
22 questions
Python 2

Quiz
•
7th - 9th Grade
20 questions
Programming

Quiz
•
9th - 11th Grade
18 questions
Final Test Python Code

Quiz
•
9th - 12th Grade
20 questions
Python Basics (CodeHS)

Quiz
•
7th - 12th Grade
15 questions
Python Revision Tour - I

Quiz
•
12th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade
Discover more resources for Computers
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
12 questions
Dividing Fractions

Quiz
•
6th Grade
9 questions
1. Types of Energy

Quiz
•
6th Grade
20 questions
Parts of Speech

Quiz
•
3rd - 6th Grade
43 questions
LinkIt Test - 24-25_BM4_7th

Quiz
•
7th Grade
6 questions
Final Exam: Monster Waves

Quiz
•
6th Grade