c/programming · by الله@lemmy.world · 1yApparently this code is not good enough can someone help me? 2 points · 6 comments · view on lemmy.world
6 Comments
setsubyou@lemmy.world · 4 pts · 1y
The second loop basically just creates the same content that’s already in line so it wants you to print that again instead.
I wonder what it would say to
الله@lemmy.world · 4 pts · 1y
الله@lemmy.world · 1 pts · 1y
vintageballs@feddit.org · 2 pts · 1y
Drop the second loop entirely and just do
print(line + '+')again at the end -lineandlin2contain the exact same string so it's unnecessary to construct it twice.الله@lemmy.world · 0 pts · 1y
ohhh this is the answer i was looking for
others suggested me some shit like
name = "World" print(f"+{'':-^{len(name)}}+\n|{name}|\n+{'':-^{len(name)}}+")
i was confused AF
MyNameIsRichard@lemmy.ml · 2 pts · 1y
consider
jdnewmil@lemmy.ca · 1 pts · 1y
Finish putting the + in the line and print it out again:
Strings also can be repeated with a * operator: