I have to accept input (using raw_input()
) as a power expression like 10**5
and then print its value. I have tried a few pieces of code but these do not give desired results:
print(f'{2**4}') #<-- prints 16 correctly
a = '{2**4}'
print(f'{{}}'.format(a)) #<-- prints {2**4}
Is it possible to achieve something like:
var = '2**4'
print(f'{<some way to expand var in here>}') #<-- prints 16