Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок0
Practice code in 'sets' lesson not accepted!
Why this practice code in Python developer "Sets lesson" is not accepted. Despite the output is correct? Thank you skills = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'} job_skills = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'} #Display the matched skill matched = skills & job_skills print(matched)
3 ответов
+ 3
It is because the practice description is really bad.
The answer is expecting HTML, not the set {HTML}.
You have to find a way to output the element as a string.
+ 1
Thank you
+ 1
It works now👍 I used 'for in' loop.
This is my new code:
skills = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'}
job_skills = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'}
#Display the matched skill
matched = skills & job_skills
for match in matched :
print(match)