carriage return prints
*When having a function run a long time, we want to follow its progress, without spamming the output.
Use {python} '\r'
in a print function. It stands for carriage return, (Schreibmaschine) which goes back to the start of the first line and "overwrites" the current line.
for epoch in range(epochs):
print(f"epoch: {epoch} / {epochs}", end="\r") # this line will overwrite the previous print!
this does a "carriage return", meaning we go back to the start of the line and overwrite that line. If you have a \n in your string, then the carriage return won't work as expected.
limit the amount of decimal places
{python}print(f"variable: {variable:.2f}")
# will only show 2 decimal places.