current position:Home>Save min, ask for an answer, ask for an answer.

Save min, ask for an answer, ask for an answer.

2022-02-02 20:25:18 CSDN Q & A

1. Known list L=[‘a’,’b’,’c’,’d’,’e’,’f’,’g’], Please complete the following questions as required .
(1) Use the positive index to get the list L The elements in ’c’
(2) Use slice to get list L Medium [’d’,’e’,’f’,’g’] Four elements
(3) Use remove() Method from list L Delete element ’a’
(4) call len() Function to get the list L The number of elements in
(5) Use for Loop through the list L  




Refer to the answer 1:
L=['a','b','c','d','e','f','g']print(L[2])print(L[3:])L.remove('a')print(L)print(len(L))for i in range(0,len(L)):    print(L[i],end=",")



Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202022025165675.html

Random recommended