Q. Find the errors:
L1 = [1, 11, 21, 31]
L2 = L1 + 2
L3 = L1 * 2
Idx = L1.index(45)
Answer =
Error in Line 2 & 4.
Because in Line 2 , 2 is integer not list so, it can not directly add to L2.
in Line 4, index 45 not exist in L1.
Answer =
Error in Line 2 & 4.
Because in Line 2 , 2 is integer not list so, it can not directly add to L2.
in Line 4, index 45 not exist in L1.
What is the reason?
ReplyDeleteBecause in Line 2 , 2 is integer not list so, it can not directly add to L2.
Deletein Line 4, index 45 not exist in L1.
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )