1
import simple_draw as sd
    
sd.resolution = (1200, 600)

rainbow_colors = (sd.COLOR_RED, sd.COLOR_ORANGE, sd.COLOR_YELLOW, 
sd.COLOR_GREEN, sd.COLOR_CYAN, sd.COLOR_BLUE, sd.COLOR_PURPLE)

def bubble(point, step):
    radius = 500
    for _ in range(7):
        radius += step
        for i in range(len(rainbow_colors)):
            sd.circle(center_position=point, radius=radius, color=rainbow_colors[i], width=4)
        
for _ in range(7):
point = sd.get_point(550, 50)
step = 5
bubble(point=point, step=step)

sd.pause()

радуга получается только последнего цвета из данного списка

1 ответ 1

1
def bubble(point, step):
    radius = 500
    for i in range(len(rainbow_colors)):
        radius += 5
        sd.circle(center_position=point, radius=radius, color=rainbow_colors[i], width=4)

for _ in range(7):
    point = sd.get_point(550, 50)
    step = 5
    bubble(point=point, step=step)

Я разобрался. Спасибо за внимание!

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.