• vintageballs@feddit.org
    link
    fedilink
    Deutsch
    arrow-up
    2
    ·
    edit-2
    2 months ago

    Drop 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.

    • الله@lemmy.worldOP
      link
      fedilink
      arrow-up
      1
      ·
      2 months ago

      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