Skip to content

Commit c6c73cf

Browse files
Use f-strings in examples where possible.
1 parent 7f1d29d commit c6c73cf

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: examples/progress-bar/a-lot-of-parallel-tasks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def stop_task(label, total, sleep_time):
3939
threads = []
4040

4141
for i in range(160):
42-
label = "Task %i" % i
42+
label = f"Task {i}"
4343
total = random.randrange(50, 200)
4444
sleep_time = random.randrange(5, 20) / 100.0
4545

Diff for: examples/prompts/asyncio-prompt.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async def print_counter():
2626
try:
2727
i = 0
2828
while True:
29-
print("Counter: %i" % i)
29+
print(f"Counter: {i}")
3030
i += 1
3131
await asyncio.sleep(3)
3232
except asyncio.CancelledError:

Diff for: examples/prompts/patch-stdout.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def thread():
2121
i = 0
2222
while running:
2323
i += 1
24-
print("i=%i" % i)
24+
print(f"i={i}")
2525
time.sleep(1)
2626

2727
t = threading.Thread(target=thread)

0 commit comments

Comments
 (0)