0
我有這個Python腳本,我沒有得到如何.strip能夠刪除「/ n」。從文檔中你必須提供.strip()字符以從字符串中刪除,並返回字符串w.o它們。/n某種特殊情況是.strip()忽略並返回一個字符串w.o它?不理解Python String Strip()方法
from urllib import urlopen
WORD_URL = "http://learncodethehardway.org/words.txt"
WORDS = []
# load up the words from the website
for word in urlopen(WORD_URL).readlines():
WORDS.append(word.strip())
print "*" * 134
print urlopen(WORD_URL).readlines()
print "*" * 134
print WORDS
真棒謝謝 –