Что мне нужно добавить во вторую инструкцию def, чтобы она работала?Вложенные defs не работают
def main():
# the user has to choose a picture and then he is asked to
pic = makePicture(pickAFile())
# the user is asked to select a color that he wants to remove from a picture
color = requestString("Which color would you like to remove?")
show(pic)
# whats wrong with this last part that doesn't make the modifications to the picture
def RemoveColor(pic, color):
r = red
g = green
b = blue
for px in getPixels(pic):
setRed(px, 0)
for px in getPixels(pic):
setGreen(px, 0)
for px in getPixels(pic):
setBlue(px, 0)
repaint(pic)
Для того, чтобы кто-то сможет помочь вам, вы должны описать свой специфический проблема. Этот фрагмент кода ссылается на множество неопределенных функций. –
В отношении несвязанной заметки вы можете указать [PEP8] (http://www.python.org/dev/peps/pep-0008/), руководство по стилю Python, чтение. –
вы определяете removeColor, но вы никогда не вызываете функцию. – furins