Q. Find the errors:


(a)

L1 = [3, 4, 5]

L2 = L1 * 3

print (L1 * 3.0)

print (L2)


(b)

L1 = [3, 3, 8, 1, 3, 0, '1', '0', '2', 'e', 'w', 'e', 'r']

print (L1 [: : -1])

print (L1 [-1: -2: -3])

print (L1 [-1: -2: -3: -4])



Answer =

(a)
Error in line 3. Means list cannot multiply by float number.

(b)
 Error in Line 4. Due to invalid syntax.

6 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post