Python Program to convert list to dictionary (Using Dictionary Comprehension)

bookmark

student = ["James", "Abhinay", "Peter", "Bicky"]  
  
student_dictionary = { stu : "Passed" for stu in student }  
  
print(student_dictionary)  


Output:

{'James': 'Passed', 'Abhinay': 'Passed', 'Peter': 'Passed', 'Bicky': 'Passed'}