In Python 3.8 and up you can use a while loop with the walrus operator like so: with open(filename) as file: while (line := file.readline().rstrip()): ...
確定! 回上一頁