الله@lemmy.world to General Programming Discussion@lemmy.ml · 29 days agoApparently this code is not good enough can someone help me?lemmy.mlimagemessage-square6fedilinkarrow-up15arrow-down12
arrow-up13arrow-down1imageApparently this code is not good enough can someone help me?lemmy.mlالله@lemmy.world to General Programming Discussion@lemmy.ml · 29 days agomessage-square6fedilink
minus-squarevintageballs@feddit.orglinkfedilinkDeutscharrow-up2·edit-229 days agoDrop the second loop entirely and just do print(line + '+') again at the end - line and lin2 contain the exact same string so it’s unnecessary to construct it twice.
minus-squareالله@lemmy.worldOPlinkfedilinkarrow-up1·29 days agoohhh 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
Drop the second loop entirely and just do
print(line + '+')
again at the end -line
andlin2
contain the exact same string so it’s unnecessary to construct it twice.ohhh this is the answer i was looking for
others suggested me some shit like
name = “World” print(f"+‘’:-^{len(name)}}+\n|\n+{‘’:-^{len(name)}}+")
i was confused AF