الله@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-squarejdnewmil@lemmy.calinkfedilinkarrow-up1·edit-229 days agoFinish putting the + in the line and print it out again: name = 'World' line = '+' for _ in name: line += '-' line += '+' print(line) print('|' + name + '|') print(line) Strings also can be repeated with a * operator: name = 'World' line = '+' + '-'*len(name) + '+' print(line) print('|' + name + '|') print(line)
Finish putting the + in the line and print it out again:
name = 'World' line = '+' for _ in name: line += '-' line += '+' print(line) print('|' + name + '|') print(line)
Strings also can be repeated with a * operator:
name = 'World' line = '+' + '-'*len(name) + '+' print(line) print('|' + name + '|') print(line)