Python数学计算

时间:2014-06-26 10:14:26

标签: python math

PCD = int(raw_input("What is PCD?   "))


QOH = int(raw_input("Quantity of holes?   "))


print "radius:   ",
Radius = float(PCD)/2
print Radius


AOS = float(360)/QOH
print "Angle of Seperation:   ",
print AOS

import math as M
def Y_value_1st(a, B):
    a*round(M.degrees(M.sin(B)))

print Y_value_1st(Radius, AOS)

这打印没有,而不是预期的答案,任何人都可以帮忙吗? 我是python的新手

1 个答案:

答案 0 :(得分:2)

你应该在函数内返回值;

def Y_value_1st(a, B):
    return a*round(M.degrees(M.sin(B)))