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=').
© 2024 OneMinuteCode. All rights reserved.