Help with the flag problem

I need help with the flag problem, i am using python 3.7 and i am very confused on how to do it