When I printed out Python print, two things were inconvenient for a long time, but it wasn't fatal, but there were parts that kept bothering me, so I'm asking you a question!
Question 1. Dynamically Assigning Left Spaces \nOr can I get a blank value as much as "February 14th (Mon): " of the previously printed values in the next print?
Currently, we divide it into two print statements and give the rjust arbitrary value to the output state below, check the print, and change the value, but when I changed the font once, the margin is twisted again.
a = 'February 14 (Mon): '
The values of len(a) and rjust don't match.
Is there a good way to print it out neatly by aligning the upper and lower positions like below? It would be nice to have an example of one print statement (\n) and two print statements, but if you don't, please share the knowledge you know!
Question 2. If I type in the print door, it automatically enters \t, so can I make sure it doesn't If you enter and print it out in a good way on the code like the code below, \t is automatically attached as much as it is indented, but is there a way to keep the indentation in the code and remove it when it is printed?python print
In the case of spaces... Doesn't it come out differently from console to console? Why don't we do it this way?
© 2022 pinfo. All rights reserved.