From a4b67f53a8c2b2f1359c6a11e0004f0dc407a59a Mon Sep 17 00:00:00 2001 From: tahirpukhta <152134239+tahirpukhta@users.noreply.github.com> Date: Wed, 13 Dec 2023 18:03:34 +0530 Subject: [PATCH] Update 9_for_exercise.py I just added an f-string in the print statement at the end! --- Basics/Exercise/9_for/9_for_exercise.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Basics/Exercise/9_for/9_for_exercise.py b/Basics/Exercise/9_for/9_for_exercise.py index 1860abd1..41e4b5ad 100644 --- a/Basics/Exercise/9_for/9_for_exercise.py +++ b/Basics/Exercise/9_for/9_for_exercise.py @@ -61,7 +61,7 @@ if i == 4: # 4 because the index starts from 0 print("Hurray! You are a rock star! You just finished 5 km race!") else: - print("You didn't finish 5 km race but hey congrats anyways! You still ran {i+1} miles") + print(f"You didn't finish 5 km race but hey congrats anyways! You still ran {i+1} miles") # 5. Write a program that prints following shape # ``` @@ -77,4 +77,4 @@ s = '' for j in range(i): s += '*' - print(s) \ No newline at end of file + print(s)