Following are the statements for creating lists , find the errors in following
statements and rewrite the same after correcting them
1. L1=1,6,a,8
2. L2=(10)
3. L1=[[0,1,2,3][‘my’,’book’]]
4. L1=[Aman,LAkshay,Arun,Nishant
Answers
Answered by
2
Answer:
1. L1 = [1, 6, a, 8]
2. L2 = [10]
3. L1 = [[0, 1, 2, 3],['my','book']]
4. L1 = ['Aman', 'Akshay', 'Arun', 'Nishant']
Explanation:
1. Square brackets [] are added.
2. Brackets () are changed to square-brackets [].
3. comma added , between both inner lists.
4. quotes '' added in the strings
Hope it helps..
Similar questions