下面援助是我的代碼部分:蟒蛇 - 與計數循環
if again():
print ('%s T: %s') % (m, hsh)
count = 1
m = 0.001
amount = m/0.01
amount = int(amount)
print ('Betting %s m') % m
apply(amount, int(count))
else:
print ('%s T: %s') % (m, hsh)
try:
count = count * 2
except:
count = 1
count = count * 2
print count
m = 0.001 * count
amount = m/0.01
amount = int(amount)
print ('K %s m') % m
apply(amount, int(count))
如果函數again()
返回true,什麼是suppost做的部分是打印計數,這是始終設置爲1,如果again()
是真的。
如果返回false,它打印數* 2
如果它返回真3倍,它打印
1
1
1
如果返回false 3倍,它打印
2
4
8
但是,它只是打印
2
2
2
如果第一次返回false,try除了未分配的變量錯誤。
我不指定變量數甚至在其他地方使用它。
聽起來像一個範圍的問題,可能是。你是否嘗試使用超出範圍的變量? – ThorSummoner
所有的變量都在那裏創建 – user3412816