I have a string variable called areacalc
. The string inside it reads 58 * 45
.
How do i get the answer out of this string? I've tried area_sum = float(areacalc)
and area_sum = areacalc
but it doesn't provide the sum answer on either occasion, it just thinks that I want area_sum
to be the same as the string itself, rather than the answer.
areacalc = str(58 * 45)
area_sum = float(areacalc)
I want area_sum to be the answer of 58 * 45 (which is 2610)