Invert Colors code python CodeHs not working properly as intended

73 Views Asked by At

My code works, but the site doesn't accept it, is there something visibly wrong in my code.

alreadypainted = 0
while front_is_clear():
    if color_is(color["red"]):
        paint("blue")
        move()
    if color_is(color["blue"]):
        paint("red")
        move()
if front_is_blocked():
    if color_is(color["red"]):
        paint("blue")
        alreadypainted += 1
    if color_is(color["blue"]) and alreadypainted < 1:
        paint("red")

BTW, all this is for my Python high school class, that is why I'm using codeHs, and that's why there is predefined functions.

I am inverting the colors correctly, but the site isn't accepting the code.

⬇this is a video of me running the code on the site⬇

https://streamable.com/c6xww3

0

There are 0 best solutions below