Computer Science
Find the errors. State reasons.
t = [1, "a", 9.2]
t[0] = 6
Python List Manipulation
4 Likes
Answer
There are no errors in this python code. Lists in python can contain elements of any type. As lists are mutable so t[0] = 6
is also valid.
Answered By
2 Likes
Related Questions
Predict the output of the following code snippet ?
Numbers = [9, 18, 27, 36] for Num in Numbers : for N in range(1, Num % 8) : print(N, "#", end=" ") print( )
Find the errors. State reasons.
t = (1, "a", 9.2) t[0] = 6
Find the errors. State reasons.
t = [1, "a", 9.2] t[4] = 6
Find the errors. State reasons.
t = 'hello' t[0] = "H"