Can someone list all the syntax and semantic errors in the following program. It's in Python/Jython.
def flag(size):
pic = makeEmptyPicture(size, size)
for x in range(size):
for y in rage(size):
pix = getPixel(pic, x, y)
#make the upper left black
if y <= (.5 * size) and x <= (.5 * size)
setColor(pix, black)
#make the upper left black
if y <= (.5 * size) and y <= (.5 * size):
setColor(pix, orange)
return pic
Line 5 missing 2 leading spaces.
Line 7 missing the trailing colon.
def fag(size):
pic = makeEmptyPicture(size, size)
for x in range(size):
for y in rage(size):
pix = getPixel(pic, x, y)
#make the upper left black
if y <= (.5 * size) and x <= (.5 * size):
setColor(pix, black)
#make the upper left black
if y <= (.5 * size) and y <= (.5 * size):
setColor(pix, orange)
return pic