Find the errors. State reasons.
t = [1, "a", 9.2] t[4] = 6
2 Likes
t[4] = 6 will raise an error as we are trying to change the value at index 4 but it is outside the current range of the list t. As t has 3 elements so its indexes are 0, 1, 2 only.
t[4] = 6
t
Answered By
1 Like
t = (1, "a", 9.2) t[0] = 6
t = [1, "a", 9.2] t[0] = 6
t = 'hello' t[0] = "H"
for Name in [Amar, Shveta, Parag] IF Name[0] = 'S': print(Name)