Python - combination


def combination(m,n):
    if n==0 or m==n:
        return 1
    else:
        return combination(m-1,n)+combination(m-1,n-1)
    
    
m = int(input('please fill m value :'))
n = int(input('please fill n value :'))
ans = combination(m,n)
print(ans)

類神經學習筆記(一)

 def km_to_mile(km):     return km / 1.609  # 真實轉換值 # 初始設定 km = float(input("請輸入公里數:")) true_mile = km_to_mile(km) factor = 0.5  #...