python学习之print输出不换行

print的即时打印会导致换行,要使得print的输出不换行,可以在字符串或者变量后面加个逗号(“,”),如下:

s = "A bird in the hand..."

for c in s:
    if c.lower() == 'a':
        print "X",
    else:
        print c,
原文地址:https://www.cnblogs.com/bangbangjiang/p/3375799.html