Given that k refers to an int that is non-negative and that plist1 has been defined to be a list with at least k 1 elements, write a statement that defines plist2 to be a new list that contains all the elements from index k of plist1 and beyond. Do not modify plist1.

Respuesta :

Answer:

plist2 = plist1 [k:]  

Explanation:

In this statement plist2 is a list which holds the elements of the list plist1 from k.

k is used here as an index of plist1.  This is used in plist1 as an index of some element. k is of a positive integer type. Here we can see (:) after k which shows that plist2 contains all elements from index k of plist1 to the end of the plist1. This plist1 contains at least the elements from kth index to beyond it (k+1).

This means that the list named as plist2 is assigned all the elements of the list plist1 from the kth index to the end (beyond) of plist1.