Sets | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Sets

‏Hello everyone, I have a problem that prevented me from completing the course in Python. This problem is in one of the puzzles. The solution is supposed to be like this, but I do not know what the problem is. skills = {'Python', 'HTML', 'SQL', 'C++', 'Java', 'Scala'} job_skills = {'HTML', 'CSS', 'JS', 'C#', 'NodeJS'} print(skills & job_skills)

13th Sep 2023, 6:47 PM
Captain Lucas
5 Answers
+ 7
Captain Lucas , to get the output as a pure string, we can use 2 possible ways: lst = ['tom'] print(lst) # output => ['tom'] not accepted print(*lst) # output => tom using the unpack operator `*` print(', '.join(lst)) # output => tom using ''.join(...) to create a string
13th Sep 2023, 9:25 PM
Lothar
Lothar - avatar
+ 4
The code you've provided is trying to find the common skills between two sets: skills and job_skills. The & operator is used to perform the set intersection operation, which returns a new set containing elements that are present in both sets.
13th Sep 2023, 6:53 PM
JAY
JAY - avatar
+ 3
It may not be clear in the instructions, but you need to output a string.
13th Sep 2023, 6:53 PM
Keith
Keith - avatar
+ 2
Lothar Thank you very much I finally solved it thanks for the help❤️🌹 Keith Driscoll Jayant Pandey Thanks everyone too
13th Sep 2023, 10:39 PM
Captain Lucas
0
So what should I do?
13th Sep 2023, 9:04 PM
Captain Lucas