我的简单底池赔率计算器有问题。
def odds(pot, call):
result = call / (pot+call)
return result
call = float(input("Ypur call size (BB): "))
pot = float(input("Pot before your call: "))
pot_odds = odds(call, pot)
print("Twoje oddsy wynoszą: " ,pot_odds)
当我将值放入变量时,我得到错误的结果,例如:如果 call = 50,pot = 150,我得到结果 = 0.75。不知道怎么解决
PS C:\Users\Rafal\Documents\Python 项目> & C:/Users/Rafal/AppData/Local/Microsoft/WindowsApps/python3.10.exe "c:/Users/Rafal/Documents/Python 项目/pot_odds_calc. py" 您的呼叫大小:50 跟注前底池大小:150 您的赔率是: : 0.75
我尝试将浮点数转换为整数,但是没有成功
def odds(pot, call):
result = pot / (call + pot)
return result
call = float(input("Your call size (BB): "))
pot = float(input("Pot before your call: "))
pot_odds = odds(pot, call) # Corrected the order of arguments
print("Your pot odds are:", pot_odds)