我似乎无法弄清楚为什么我不能让定义的函数工作。我对python很陌生,但感觉它应该按原样工作。
import math
import random
answer = 0
# i *think* this means that the value of the variable answer in the function
# ma_formula() can be used outside the function once the function is done right?
def my_forumla():
answer = a * b * c;
a = math.pi;
b = random.randint(2,288);
c = eval(input("Enter your number here: \n"));
print(str(a) + ", " + str(b) + ", " + str(c))
my_formula();
print(answer);