Hello.
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!
# output
February 14 (Mon): (AA type) abcdef
(Type B) abcdef
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?
a = 'a'
if a:
print('''
Hello.
Hello.
''')
# Current output
Hello.
Hello.
# The output you want
Hello.
Hello.
print('''
\nHello.
\nHello.
''')
Or
print('\nHello.\nHello.')
In the case of spaces... Doesn't it come out differently from console to console? Why don't we do it this way?
print('abcd\n\tbcd\n\tcdf')
>>
abcd
bcd
cdf
577 PHP ssh2_scp_send fails to send files as intended
572 Understanding How to Configure Google API Key
567 Who developed the "avformat-59.dll" that comes with FFmpeg?
884 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
567 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.