Can someone explain why this code isn't being accepted in the practice problem? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula gr√°tis
0

Can someone explain why this code isn't being accepted in the practice problem?

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. You can use the intersect operator to get the values present in both sets. https://code.sololearn.com/c5crkue5wa6i/?ref=app https://code.sololearn.com/c5crkue5wa6i/?ref=app

14th Apr 2021, 2:53 AM
Ify Nonyelu
12 Respostas
+ 26
print(' '.join(skills & job_skills))
14th Apr 2021, 3:43 AM
Ahmed Yasser
Ahmed Yasser - avatar
+ 12
skills = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'} job_skills = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'} print(*skills & job_skills)
29th Oct 2022, 11:38 AM
–í–ł—ā–į–Ľ–ł–Ļ –ú–Ķ–Ĺ—ą–ł–ļ–ĺ–≤
–í–ł—ā–į–Ľ–ł–Ļ –ú–Ķ–Ĺ—ą–ł–ļ–ĺ–≤ - avatar
+ 8
Yetco As there is single common set so pop method will also help you to get result skill = skills & job_skills print (skill.pop());
14th Apr 2021, 5:04 AM
AÕĘJ
AÕĘJ - avatar
+ 6
The output here is {'HTML'} Try to print like plain HTML Store the common value in another set or list and print one by one using index value I hope this will work
14th Apr 2021, 3:41 AM
Arun Ruban SJ
Arun Ruban SJ - avatar
+ 2
skills = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'} # Candidates skills job_skills = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'} # Skills required match = skills.intersection(job_skills) # Find matches print(match.pop()) # Pop the match out so we are not just printing a set with # the curly braces and everything
9th Jan 2022, 3:25 PM
Andrew Sharon
+ 2
My Answer: skills = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'} job_skills = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'} skill = skills & job_skills print (skill.pop());
10th Nov 2022, 8:19 AM
Pooja Patel
Pooja Patel - avatar
+ 1
Thank you for your help, I really appreciate it.
14th Apr 2021, 3:52 AM
Ify Nonyelu
+ 1
print(' '.join(skills & job_skills)) –ö—ā–ĺ-–Ĺ–ł–Ī—É–ī—Ć –ľ–ĺ–∂–Ķ—ā –ĺ–Ī—ä—Ź—Ā–Ĺ–ł—ā—Ć –Ņ–ĺ—á–Ķ–ľ—É —ć—ā–ĺ—ā —Ā–Ņ–ĺ—Ā–ĺ–Ī —Ā—Ä–į–Ī–ĺ—ā–į–Ľ?
13th Dec 2021, 6:11 PM
Roman Stribunov
Roman Stribunov - avatar
+ 1
print(' '.join(skills & job_skills)) –≤–Ķ—Ä–ĺ—Ź—ā–Ĺ–ĺ —Ā—Ä–į–Ī–ĺ—ā–į–Ľ, –Ņ–ĺ—ā–ĺ–ľ—É —á—ā–ĺ –Ĺ–į –≤—č—Ö–ĺ–ī–Ķ —Ö–ĺ—ā—Ź—ā –Ņ–ĺ–Ľ—É—á–ł—ā—Ć –∑–Ĺ–į—á–Ķ–Ĺ–ł–Ķ –Ī–Ķ–∑ –ļ–į–≤—č—á–Ķ–ļ –ł —Ā–ļ–ĺ–Ī–ĺ–ļ
4th Jan 2022, 6:35 AM
Aleksandr Suprun
Aleksandr Suprun - avatar
0
skills = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'} # skills of candidates job_skills = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'} # the skill required to the job # the first way print(skills & job_skills) # second way newSet = set() for i in skills: if i in job_skills: newSet.add(i) print(newSet) # the 3rd way skiset = {i for i in skills if i in job_skills} print(skiset)
24th Nov 2021, 11:09 PM
Mohammad Jamal Mahmoud Al Jadallah
Mohammad Jamal Mahmoud Al Jadallah - avatar
0
Hello you there, so... what can i say or asked you :D probably i dont understand something here ######## look at this code ############# ‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď first = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'} second = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'} print(first | second) print(first & second) print(first - second) print(second - first) print(first ^ second) ############ output ################## ‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď {'CSS', 'Python', 'C#', 'C++', 'Scala', 'SQL', 'NodeJS', 'Java', 'JS', 'HTML'} {'HTML'} {'Python', 'Scala', 'SQL', 'Java', 'C++'} {'C#', 'NodeJS', 'JS', 'CSS'} {'CSS', 'Python', 'SQL', 'NodeJS', 'Java', 'C#', 'Scala', 'C++', 'JS'} and everythis is fine according to this lesson: "SETS" but... yeap there is always but :D when i tring compiled this code :D it dosnt work :D And my questio is.... WHY ? :D #########orginal name of variables :D ################# ‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď skills = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'} job_skills = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'} ##### my "solution" according to lesson "SETS" ######## ‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď‚Üď print(skils & job_skills) so... WHY ? " TEST CASE 1 " == FAILED ! :D almost like " SOLOLEARN FATALITY:D "
20th Mar 2023, 8:47 PM
Pawel
Pawel - avatar
0
BTW :) i know that there is a "typo" but it dosnt change ANYTHING :D ‚Üď print(skils & job_skills)
20th Mar 2023, 8:53 PM
Pawel
Pawel - avatar