Help me in solving PSPP81 problem

My issue

Program

My code

global_var = 10

def my_function():
    print(global_var)  # Accessing the global variable

print(global_var)  # Accessible here
my_function()  # Accessible here
def my_function():
    local_var = 20  # Local variable
    print(local_var)  # Accessible here

print(local_var)  # Error: local_var is not defined (outside its scope)
def my_function():
    local_var = 20  # Local variable
    print(local_var)  # Accessible here

print(local_var)  # Error: local_var is not defined (outside its scope)

Learning course: Learn Python
Problem Link: CodeChef: Practical coding for everyone

Please don’t add any more code here. Just click ‘Submit’ to run the given code and check the result