#๐Ÿ”’ how do i rearrange a printed message

32 messages ยท Page 1 of 1 (latest)

glacial dome
cunning brambleBOT
#

@glacial dome

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

glacial dome
cunning brambleBOT
# glacial dome

Please react with โœ… to upload your file(s) to our paste bin, which is more accessible for some users.

bleak summit
# glacial dome

that would be pretty difficult but you'd have to print its composite sections with the title

#

!e

#

oops

glacial dome
#

i just a lot of error messages

bleak summit
glacial dome
#

i tried printing both of variables

bleak summit
#

oops

cunning brambleBOT
bleak summit
#

there we go

#

we have two strings: yml hello hi wow ```yml
this
is
awesome


then we get their lines and print them with some padding between them
#

: <15 just makes it so that it adds spaces to the end of the string until the total length is 15

glacial dome
#

cuz i got no idea lol

#

i am still kinda new to python

bleak summit
glacial dome
bleak summit
#

then take your table, turn that into a string (might be harder) and then split that into lines too

#

then you can zip the two together like this: ```py
l1: list[str] = ...
l2: list[str] = ...

for a, b in zip(l1, l2):
print(f"{a: <15}{b}")


`a` is the line from `l1` and `b` is the line from `l2`
glacial dome
#

are u sure it won't mess up the print like add lines between the banner?

glacial dome
#

idk terminal displays text weird sometimes

bleak summit
#

depends on how wide your terminal is

cunning brambleBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.