To remove string “hello” from list1, we use which command ?
A. list1.remove(“hello”)
B. list1.remove(hello)
C. list1.removeAll(“hello”)
D. list1.removeOne(“hello”)
Answer:A
To remove string “hello” from list1, we use which command ?
A. list1.remove(“hello”) B. list1.remove(hello) C. list1.removeAll(“hello”) D. list1.removeOne(“hello”)
Explanation:Execute in the shell to verify. 9. Suppose list1 is [3, 4, 5, 20, 5], what is list1.index(5) ?