2014-06-26 171 views
1
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新手Python數學計算

+1

你的函數不返回任何東西。 – vaultah

回答

2

你應該在函數內返回值;

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

感謝您的幫助 – user3778839

+0

不客氣,如果答案是肯定的,您應該關閉問題;單擊以將此答案設置爲您接受的答案。 @ user3778839 – myildirim