- 1
Answer the following :
How can you return a sub list from a list returning 3 consececutive elements where the last element links back to the first given any index into the list?(syntax is python) * for eg. given index 3 for list = [1,2,3,4,5], would return[5,1,2]. A. return list[index:]+list[:index+3] B. return list[index:index+3]+list[:len(list)-index] C. return list[index+3:]+list[:len(list)-index] D. return list[index:index+3] + list[:max(0,-1*(len(list)-index-3))]
1 ответ
0
Is this question or challenge? or Homework?
Don't post challenges here. You should post them in your feed.
This Q&A section is only for coding related questions.
https://www.sololearn.com/discuss/1316935/?ref=app