a = input()
print(a[:2],"sh"
print(a[3:]"Minutes")
It comes out like this because I used and
but how do I print out without spacing?
(I want to minimize the running time!))
python print format-string
https://docs.python.org/ko/3/tutorial/inputoutput.html
>>> a = input()
07:10
>>> print(a[:2],"si")
07 si
>>> print(f"{a[:2]}si")
07si
>>> print("%ssi"%(a[:2]))
07si
>>> print("{0}si".format(a[:2]))
07si
The print function supports the sep factor, and the default is '
.
If you have a print('1', '2')
code, try print('1', '2', step=').
860 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
572 PHP ssh2_scp_send fails to send files as intended
566 Understanding How to Configure Google API Key
563 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
589 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.