wlbk.net
当前位置:首页 >> python 统计一句话中最长单词 >>

python 统计一句话中最长单词

if __name__ == '__main__': say_words = rawinput(“请输入要测试的一句话”) word_list = say_words.split(',') //用逗号转换为列表 word_len_list = [len(word) for word in say_words] max_word_len = max(word_len_list) for word in say_wor...

def num_input(): count=1 data_list=[] while True: count += 1 data=input("enter a number:") if data == "": print(count-2,"numbers entered") break number=float(data) data_list.append(number) print("sum:",sum(data_list),"max:", ma...

网站首页 | 网站地图
All rights reserved Powered by www.wlbk.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com