Test: Computer Science

1.

What line number makes the following Python Code not execute? (1:, 2:, 3:,... represents line numbers)

1: x=[]

2: y=[]

3: z=[]

4: for i in range(10):

5:      x.append(i)

6:      y.append(x[i]+2*x[i])

7:      z.append(x[i]+y[i]**2)

8: print(z)

9: string="The fourth element of z is "+z[3]

10: print(string)

 

 

Line 9

Line 8

Line 5

Line 7

Line 6

1/2 questions

0%
Learning Tools by Varsity Tutors