python中print輸出一行,如果想多次輸出的內容不換行,可以在print后面加逗號
例如
每個輸出一行
phrase = "abcdefg" # Add your for loop for char in phrase: print char
a
b
c
d
e
f
g
輸出在同一行
phrase = "A bird in the hand..." # Add your for loop for char in phrase: if(char == "A" or char == 'a'): print 'X', else: print char, #Don't delete this print statement! print
X b i r d i n t h e h X n d . . .