0
Module 7/ Sets practice
In this quest I should display the matching skills for the job description but I don't understand what is wrong. I used an intersection. skills = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'} job_skills = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'} print(skills & job_skills)
6 Respuestas
+ 4
You need to output 'HTML' as a string.
+ 1
👍🤝
0
Ok. How to do it?
0
Because Set's are unordered you can use a for loop to iterate through the Set:
for skill in (skills&job_skills):
print(skill)
Otherwise (skills&job_skills) on its own will just create a new Set.
0
Thank you
0
You can use the .join method:
skills = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'}
job_skills = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'}
operation = skills & job_skills
result = ', '.join(operation)
print(result)