在print()括号内要输出的参数后面加上end,只后加上你要的间隔符,如:
phrase = "A bird in the hand..."
for char in phrase:
if(char == "A" or char == 'a'):
print ('X')
else:
print (char')
phrase = "A bird in the hand..."
for char in phrase:
if(char == "A" or char == 'a'):
print ('X',end='')
else:
print (char,end='')