Skip to content
← Back to Community
Help on text alignment/Python
Profile icon
JerryTheMouse

I'm trying to align text so on side of the text is aligned to the left and the other to the right... Please help.
https://repl.it/@JerryTheMouse/Experimental-Stock-Simulation?language=python3

Voters
Profile icon
DevamaePP
Profile icon
Shee-Kai-JieKai
Profile icon
SantinoVizzini1
Profile icon
oliviazurek
Profile icon
B0T
Profile icon
JerryTheMouse
Comments
hotnewtop
Profile icon
mat1

I made a Repl with a text alignment function here: https://repl.it/@mat1/text-align
I tried putting as many comments as possible but hopefully they're not too much ;)

Please upvote my comment if it was helpful or useful in any way

Profile icon
JerryTheMouse

@mat1 Thanks, but when i ran your func, hello world appeared on 3 lines. If it isn too much of a request, can you fix it?

Profile icon
ash15khng

@JerryTheMouse His code has 3 demonstrations of the function at lines 36-38. If you want to use it in your code, copy and paste the function into your code, then use the function text_align instead of print and add the alignment.

Profile icon
JerryTheMouse

@ash15khng I perfectly get that, but still theoretically it will still not align
I know there’s 3 ex., but shouldn’t they be more ore less centred, etc.?