
Pyton lists - del() - error index
Authored by Larbi Yazid
Computers
4th - 12th Grade
Used 19+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
fruits = ["apple", "banana", "cherry"]
Choose the correct instruction to delete "banana"
fruits[1].delete()
fruits[1].delete
delete fruits[1]
del fruits[1]
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
numbers = [7,4,9,6,5,2,1]
Which of the following is the correct instruction to delete 9 ?
del numbers[2]
del numbers[3]
del numbers[9]
del numbers[-4]
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
See the code and the output in the image.
What is the missing statement in the red box?
del banana
del thislist[1]
del thislist[2]
delete thislist[1]
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
subjects = ["Computer", "Math", "English"]
Which of the following generates an index error?
subjects[0]
subjects[-1]
subjects[3]
subjects[-3]
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
numbers = [6,3,9,8,2,1]
Which of the following will generate an index error?
numbers[9]
numbers[1]
numbers[-6]
numbers[5]
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
results = [98.5 , 99.2 , 92.7 , 97.4]
Which of the following will NOT generate an index error?
results[3]
results[4]
results[5]
results[-5]
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?