Just started working with Python and I would like to know how to create a set only from user input. I'm working on a project where a student has to take some courses, however there are some prerequisites to some of the courses. The first line of input from the user will be the number of courses and the total number of dependencies, as such:
5 4
The next input (however many there may) will be the course IDs and what prerequisites the courses may have, such as:
1 3
2 3
4 1
4 2
Currently I am just creating it myself, like this:
data ={
'1': set('3'),
'2': set('3'),
'4': set('1'),
'4': set('2')
}
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)