الله@lemmy.world to General Programming Discussion@lemmy.ml · 9 months agoApparently this code is not good enough can someone help me?lemmy.mlimagemessage-square7linkfedilinkarrow-up14arrow-down13
arrow-up11arrow-down1imageApparently this code is not good enough can someone help me?lemmy.mlالله@lemmy.world to General Programming Discussion@lemmy.ml · 9 months agomessage-square7linkfedilink
minus-squarejdnewmil@lemmy.calinkfedilinkarrow-up1·9 months 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)