CJCoding With Joseph
15free / daySign inCreate account

Enrol In The Course

A Course is not a kind of Student, so it does not inherit from it; instead it HAS a list of students in the attribute students. Write the body of enrol so it appends the given student object to that list. Do NOT write a main block or any top-level test code; the tests construct the class. Input: two lines, each a name, which the tests turn into Student objects and enrol in order; they then print how many students the course holds, then each name on its own line.

Expected Output:

2
Maya
Omar

= newline. The output ends with a newline — print one after the last line.

Hints2 available
Topics:
Classes
📥 Auto-Input:
Maya\nOmar\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.