logo

Crowdly

Browser

Add to Chrome

Which one of the following pictures appear on your canvas when the following Pyt...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Which one of the following pictures appear on your canvas when the following Python program is executed?

Watter een van die volgende prentjies verskyn op jou verfdoek wanneer die volgende Python program uitgevoer word?

#circles.py

import stddraw

def main():

    for k in range(1,5):

        for j in range(1,5):

            x_cor = j*0.2

            y_cor = k*0.2

            if ((k%j == 0) or (j%k == 0)):

                stddraw.setPenColor(stddraw.BLUE)

                stddraw.filledCircle(x_cor, y_cor, 0.1)

            else:

                stddraw.setPenColor(stddraw.GREEN)

                stddraw.filledCircle(x_cor, y_cor, 0.1)

    stddraw.show()

if __name__ == "__main__": main()

          

The lines above were not generated by the program. Color hues of actual output may differ slightly from the depiction above.

Die lyne hierbo is nie deur die program geskep nie. Kleurskakerings van ware afvoer mag effens verskil van die uitbeeldings hierbo.

More questions like this

Want instant access to all verified answers on stemlearn.sun.ac.za?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome