最近はPython3でコードを書くことも増えてきているけど、僕のPythonの知識がPython2.7で止まっているのでPython2から3への主な変更点について改めて調べました。自分が普段利用する際あまり関係なさそうなところは割愛してます。 1/2の結果がfloatになる。
# the price of a given stock on day i. # Design an algorithm to find the maximum profit. # You may complete at most k transactions. max_buy = [float("-inf") for _ in xrange(k + 1)] max_sell = [0 for _ ...
The exact quote I got from Copilot365 while working on a task for me was, "It looks like the generation process ran into a compatibility issue with a library (xrange is not defined in Python 3). " ...