LED code question

Thanks for your help!
I thought it worked like that but wasn't sure.

I will use the code tag next time! didn't know that.

Thanks!