# test scoping rules# explicit global variablea=1deff():globalaglobala,a# should be able to redefine as globala=2f()print(a)# explicit nonlocal variabledeff():a=1defg():nonlocalanonlocala,a# should be able to redefine as nonlocala=2g()returnaprint(f())