我正在尝试在input.txt中获得此字词列:
Suzuki music
Chinese music
Conservatory
Blue grass
Rock n roll
Rhythm
Composition
Contra
Instruments
转换成这种格式:
"suzuki music", "chinese music", "conservatory music", "blue grass", "rock n roll", "rhythm"...
这段代码:
with open ('artsplus_stuff.txt', 'r') as f:
list.append(", ".join(['%s' % row for row in f.read().splitlines()]))
for item in list:
item.lower()
print list
返回列表,但首字母大写。
['铃木音乐,中国音乐,音乐学院,蓝草,摇滚乐,节奏,作曲,打击乐,乐器']
我该如何将所有项目转换为小写?
慕森王
幕布斯6054654
白衣染霜花
相关分类