Computer Science, asked by shiny2923, 1 year ago

Consider the following lines of Python code.

x = [13,4,17,1000] w = x[1:] u = x[1:] y = x u[0] = 50 y[1] = 40

Which of the following is correct?

x[1] == 40, y[1] == 40, w[0] == 4, u[0] == 50

x[1] == 50, y[1] == 40, w[0] == 50, u[0] == 50

x[1] == 4, y[1] == 40, w[0] == 4, u[0] == 50

x[1] == 40, y[1] == 40, w[0] == 50, u[0] == 50

Answers

Answered by vcharithacherry
1

Answer:

3

Explanation:

x=[13,4,17,1000]

w=[4,17,1000]

u=[4,17,1000]

y=[13,4,17,1000]

-->  u[0]=50 =>u=[50,17,1000]

-->   y[1]=40 =>y=[13,40,17,1000]

option 3:

x[1]=4,y[1]=40,w[0]=4,u[0]=50

Similar questions