+ 1

Job Sets Challenge

I've entered this code as the answer to one of the puzzles in the Sets modules print(list((skills & job_skills)) but the resolution code is this: print(list((skills & job_skills)[0]) the module says my code is incorrect. Why does [0] make it correct? Any insight?

5th Mar 2022, 1:45 AM
Shalisa Miller
6 Answers
+ 2
Did you look at the difference between the outputs? If you had you would see that the difference is; ['HTML'] vs HTML You want the element within the list not the list itself.
5th Mar 2022, 1:53 AM
ChaoticDawg
ChaoticDawg - avatar
+ 2
Appreciate the help. I was abke to see the difference woth the correct parenthetical closing
5th Mar 2022, 1:59 AM
Shalisa Miller
+ 1
You are working on a recruitment platform, which should match the available jobs and the candidates based on their skills. The skills required for the job, and the candidate's skills are stored in sets. Complete the program to output the matched skill. starter code: skills = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'} job_skills = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'} my full answer: skills = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'} job_skills = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'} print(list((skills & job_skills)) correct answer: skills = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'} job_skills = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'} print(list((skills & job_skills)[0])
5th Mar 2022, 1:46 AM
Shalisa Miller
+ 1
You are also missing a closing ) parentheses for your print statement.
5th Mar 2022, 1:57 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
lol it doesnt even work on mine when i use print(list((skills & job_skills)[0])))
15th Oct 2023, 1:51 AM
Binam Adhikari
Binam Adhikari - avatar
0
I didnt because i receive an error when my original answer is run
5th Mar 2022, 1:55 AM
Shalisa Miller