+ 1

Help understand please

What in solution is [0]? skills = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'} job_skills = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'} print(list(skills&job_skills)[0])

24th Jun 2022, 8:38 PM
Yervand Makaryan
Yervand Makaryan - avatar
2 Answers
+ 4
skills, job_skills are two sets. Apply bitwise and & operation between them. You get a set of values which are in both. On result, making a list. Now [0] apply will pick value at index 0
24th Jun 2022, 9:21 PM
Jayakrishna 🇼🇳
+ 1
Now i understand. Thank you
25th Jun 2022, 2:58 AM
Yervand Makaryan
Yervand Makaryan - avatar