+ 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?
6 Respuestas
+ 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.
+ 2
Appreciate the help. I was abke to see the difference woth the correct parenthetical closing
+ 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])
+ 1
You are also missing a closing ) parentheses for your print statement.
0
I didnt because i receive an error when my original answer is run
0
lol it doesnt even work on mine when i use
print(list((skills & job_skills)[0])))