The program is a python script that replaces the elements of a list with elements from another list based on the index value of the second list.
Here's what the program does in detail:
a = ['Tutor Joes', 'Computer', 'Education'] b = [2 ,1 ,0 ,1 ,0 ,2 ,2 ,0 ,1 ,0 ,1 ,2] print("List 1 : " , a) print("List 2 : " , b) res = [a[i] for i in b] print ("After Index Elements Replacements is : " ,res)
List 1 : ['Tutor Joes', 'Computer', 'Education'] List 2 : [2, 1, 0, 1, 0, 2, 2, 0, 1, 0, 1, 2] After Index Elements Replacements is : ['Education', 'Computer', 'Tutor Joes', 'Computer', 'Tutor Joes', 'Education', 'Education', 'Tutor Joes', 'Computer', 'Tutor Joes', 'Computer', 'Education']
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions