今日のハマリ
次のコードが終らなかった.
print tot_seats occupied = 0 while occupied < tot_seats: print occupied, tot_seats, occupied < tot_seats occupied += 1
tot_seats
にはsys.argv
由来の8が入っている.↑を実行すると
8 0 8 True 1 8 True ... 8 8 True 9 8 True ... 13092 8 True 13093 8 True ...
となるばかり.
ふと気付いたら,8が文字列"8"
だった(ぉぃ).int
噛まさにゃ.文字列はクォートで囲ってくれるようなデバッグ向け印字手続きないの? Rubyだとp
ってのがあるんだけど.