+ 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)
5 ответов
+ 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
+ 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.
+ 3
It may not be clear in the instructions, but you need to output a string.
+ 2
Lothar
Thank you very much I finally solved it thanks for the help❤️🌹
Keith Driscoll
Jayant Pandey
Thanks everyone too
0
So what should I do?