Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+7 votes

how should I use the parameter numBubbles in this function?

asked in CSC201 Spring 2021 by (1.1k points)

2 Answers

+5 votes

numBubbles is the number of bubbles you have to create and add to the list.
Therefore, that is the range of the for loop which you create the bubbles.

answered by (1 point)

for numBubbles in range (DEFAULT_BUBBLE_NUM) ?


No, the range should be numBubbles because you will create bubbles for numBubbles times.


So inside the for loop, is it correct to use a function self.circle.draw() to draw bubbles with different positions? Thank you


In the setupBubbles function, you just need to create bubbles and add them to a list. You shouldn't draw them. You will draw them in the main function.

+4 votes

You use numBubble to loop through every bubble you want to create

answered by (1 point)