def para(value):
if(value==1):
a1=10
b1=11
c1=12
d1=13
elif(value==2):
a1=20
b1=21
c1=22
d1=23
elif(value==3):
a1=30
b1=31
c1=32
d1=33
else:
print("wrong input")
dict_a=dict({'a':a1,'b':b1})
dict_b=dict({'c':c1,'d':d1})
return(dict_a, dict_b)
def main():
global dict_a, dict_b
value=input("enter the choice: \n1. 1st \n2. 2nd \n3. 3rd \n4. 4th")
[dict_a, dict_b]=para(value)
main()
The error that I get is:
dict_a=dict({'a':a,'b':b})
UnboundLocalError: local variable 'a1' referenced before assignment