raw_input是用来提示输入的
把输入的字符以转化为list
>>> input_words = raw_input(‘input some words: ‘)
input some words: shang hai zi lai shui lai zi hai shang.
>>> input_words
‘shang hai zi lai shui lai zi hai shang.’
使用 map 将数据转换为 list
>>> input_list = map(str, input_words.split())
>>> input_list
[‘shang’, ‘hai’, ‘zi’, ‘lai’, ‘shui’, ‘lai’, ‘zi’, ‘hai’, ‘shang.’]
Leave a Reply