Question: plz answers these short Qs in python language Q1-Assume that a variable named plist refers to a list with 12 elements, each of which is

plz answers these short Qs in python language

Q1-Assume that a variable named plist refers to a list with 12 elements, each of which is an int. Assume that the variable k refers to a value between 0 and 6. Write a statement that assigns 15 to the list element whose index is k.

Q2-Assume that plist refers to a list containing exactly five elements. Assume, in addition, that j refers to an int with a value that is between 0 and 3.Write a statement that associates a new value with the element of the list indexed by j. This new value should be equal to twice the value of the next element of the list (i.e. the element after the element indexed by j.

Q3-Assume that play_list refers to a non-empty list, and that all its elements refer to values of type int. Write a statement that associates a new value with the first element of the list. The new value should be equal to twice the value of the last element of the list.

Q4-Given that plist1 and plist2 both refer to lists, write an expression that evaluates to a list that is the concatenation of plist1 and plist2. Do not modify plist1 or plist2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!