I wanto do something like this, is it possible in python.
f = 'free'
p = 'paid'
if version is f:
APP_VER = 'APP_FREE'
elif version is p:
APP_VER = 'APP_PAID'
s_email = webapp2.get_app().config[APP_VER]['SUPPORT_EMAIL']
Error: UnboundLocalError: local variable 'APP_VER' referenced before assignment
Any idea!
there is a possibility
versionis neitherfnorp. Include anelsepart. Also (as @jamylak notes) use==to compare strings, notis:Another way (great improvement if the list of versions is longer):