There is a friend group of four classmates: Marco, James, Jane, and Dan. Kate is Jane's friend, and Bob is Marco's younger brother. Kate and Bob aren't their classmates and do not belong to this group.
One day, the four friends decided to go to the swimming pool and then to the cinema. Bob also wanted to go to the movies with them, and Kate joined the four friends at the pool. Bob didn't go to the swimming pool, and Kate didn't go to the cinema.
These events are shown in the code below.
import copy
classmates = ['Marco', 'James', 'Jane', 'Dan']
cinema = classmates
swimming = copy.copy(classmates)
cinema.append('Bob')
swimming.append('Kate')How did the code affect the composition of the groups, and what needs to be changed to keep the conditions correct?
Only the copy() and deepcopy() functions are used to copy objects.