It’s important to read error messages carefully. Your message says that you put the global keyword in the wrong place.
Can copy and paste the part of your code where you use global? Please copy the text, not an image of the text, and put triple quotes around the code.