Foundations-of-Applied-Mathematics / lab-issue-tracker

0 stars 0 forks source link

Issue on page /PythonEssentials/Exceptions_FileIO/Exceptions_FileIO.html #51

Open jhtullis opened 1 month ago

jhtullis commented 1 month ago

In additional material, there is this code snippet:

iters = int(1e7)
chunk = iters // 20
for i in range(iters):
    print("r[{:<20}] i = {}".format('='*((i//chunk)+1), i), end='', flush=True)

This code doesn't work as advertised, it is missing a backslash before the "r" in the string. It should read:

iters = int(1e7)
chunk = iters // 20
for i in range(iters):
    print("\r[{:<20}] i = {}".format('='*((i//chunk)+1), i), end='', flush=True)