しばらくすると何らかの理由で私のコードが発生し
OverflowError: cannot convert float infinity to integer
ます. これを行う理由がわかりません。フロートはほとんど使用されておらず、inf は使用されていません。
def bugsInCode(begin):
bugs = begin
while bugs != 0:
print "%s bugs in the code, %s bugs\ntake one down patch it around, %s bugs in the code!" % (bugs, bugs, int(bugs * 1.5))
bugs = int(bugs * 1.5)
ただし1.5
、 a1
または a2
作品に置き換えます。なんで?