Ask coding questions

← Back to all posts
load screen help
Brendan23 (166)

if you run the repl, there is a space between the and the green highlight in the beginning and the end. how can I remove that space?

Answered by OldWizard209 (1520) [earned 5 cycles]
View Answer
Comments
hotnewtop
OldWizard209 (1520)

You just need to change 60 to 59 on line 11:

for i in range(59):
  emt += ' '

Output:

Coder100 (18109)

use sep=''

you see, with each argument, python adds a space in between, so you can remove that:

print('‖','\033[0;0;42m'+get,'\033[0;0;0m'+emt,'‖', sep = '')

line 15

Brendan23 (166)

@Coder100 there is still a space at the ending, the beginning is fixed though.

Coder100 (18109)

the symbol naturally has a space, if you look carefully:


@Brendan23

either use a different symbol, or you have to live with it

LukeWright (285)

instead of

print('‖','\033[0;0;42m'+get,'\033[0;0;0m'+emt,'‖')

do

print('‖'+'\033[0;0;42m'+get,'\033[0;0;0m'+emt+'‖')
Brendan23 (166)

@LukeWright there is still a space at the ending, the beginning is fixed though.

LukeWright (285)

then you should change the middle , to a + as well @Brendan23

Brendan23 (166)

@LukeWright same thing, the ending still has a space.

LukeWright (285)

Got it. remove the +emt from your code so its just

print('‖'+'\033[0;0;42m'+get,'\033[0;0;0m'+'‖')

@Brendan23

Brendan23 (166)

@LukeWright alright, that works, how do I get the empty space that was there before?(I could probably figure it out with some time, but I'm lazy.)