Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update 9_for_exercise.py
I just added an f-string in the print statement at the end!
  • Loading branch information
tahirpukhta authored Dec 13, 2023
commit a4b67f53a8c2b2f1359c6a11e0004f0dc407a59a
4 changes: 2 additions & 2 deletions Basics/Exercise/9_for/9_for_exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ```
Expand All @@ -77,4 +77,4 @@
s = ''
for j in range(i):
s += '*'
print(s)
print(s)