Apr-22-2017, 05:26 AM
Hey guys I am having a real hard time understanding this question and would just appreciated some clarification on what the instructions are actually asking me to do. I know how to do lists and have a basic understanding of nested loops but executing it is another story
I have to make two class lists, one with Maths students and the other with Computer Science students.
mathStudents = ['Audrey', 'Ben', 'Julia', 'Paul', 'Gerry', 'Sue', 'Helena', 'Harry', 'Marco', 'Rachel', 'Tina', 'Mark', 'Jackson']
csStudents = ['William', 'Aroha', 'Melissa', 'Sue', 'Ben', 'Audrey', 'Susan', 'Mark', 'Hemi', 'Brendan', 'Paul', 'Barry', 'Julia']
I need to use these lists in nested loops to find out which students are enrolled in both classes and count the total number of students.
My output should look like the following:
Student: Audrey is enrolled in both classes
Student: Ben is enrolled in both classes
Student: Julia is enrolled in both classes
Student: Paul is enrolled in both classes
Student: Sue is enrolled in both classes
Student: Mark is enrolled in both classes
6 students are enrolled in Computer Science and Maths
I have to make two class lists, one with Maths students and the other with Computer Science students.
mathStudents = ['Audrey', 'Ben', 'Julia', 'Paul', 'Gerry', 'Sue', 'Helena', 'Harry', 'Marco', 'Rachel', 'Tina', 'Mark', 'Jackson']
csStudents = ['William', 'Aroha', 'Melissa', 'Sue', 'Ben', 'Audrey', 'Susan', 'Mark', 'Hemi', 'Brendan', 'Paul', 'Barry', 'Julia']
I need to use these lists in nested loops to find out which students are enrolled in both classes and count the total number of students.
My output should look like the following:
Student: Audrey is enrolled in both classes
Student: Ben is enrolled in both classes
Student: Julia is enrolled in both classes
Student: Paul is enrolled in both classes
Student: Sue is enrolled in both classes
Student: Mark is enrolled in both classes
6 students are enrolled in Computer Science and Maths