参考print的官方文档
print(...)
print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
Prints the values to a stream, or to sys.stdout by default.
Optional keyword arguments:
file: a file-like object (stream); defaults to the current sys.stdout.
sep: string inserted between values, default a space.
end: string appended after the last value, default a newline.
flush: whether to forcibly flush the stream.
>>> s = 'k'
>>> k = 'e'
>>> print(s+k)
ke
>>> print(s,k)
k e
两个变量之间默认使用空格隔开
打印字符串:
def review():
t = int(input())
for i in range(t):
s = input()
print(s[::2], s[1::2])
s[i:j:k]默认i=0,j不输入默认到最后一位, k=1