摘要: li = ["alex","WuSir","ritian","barry","wenzhou"]s = "_".join(li)print(s)结果: alex_WuSir_ritian_barry_wenzhou 阅读全文
posted @ 2019-05-28 13:50 冰灬荷 阅读(71) 评论(0) 推荐(0) 编辑
摘要: li = ["苍老师" ,"东京热" ,"武藤兰" ,"波多野结衣"]lis = []content = input("请输入评论内容")for i in li: if i in content: content = content.replace(i,"*" * len(i)) #要从新赋值lis 阅读全文
posted @ 2019-05-28 13:46 冰灬荷 阅读(146) 评论(0) 推荐(0) 编辑
摘要: li = ["TaiBai", "ale xC", "AbC ", "egon", "ri TiAn", "WuSir", " aqc"]lis = []for i in range(len(li)): li[i] = li[i].replace(" ","") if li[i][0] == "A" 阅读全文
posted @ 2019-05-28 13:31 冰灬荷 阅读(266) 评论(0) 推荐(0) 编辑
摘要: lis = []for i in range(31): lis.append(i)print(lis)for j in lis: if j %3 ==0: lis[j] = "*"print(lis) 阅读全文
posted @ 2019-05-28 13:27 冰灬荷 阅读(498) 评论(0) 推荐(0) 编辑
摘要: name = input("请输入姓名:")address = input("请输入地点:")honey = input("请输入爱好:")print("敬爱可亲的 %s,最喜欢在 %s地方干%s" %(name,address,honey)) 阅读全文
posted @ 2019-05-28 06:43 冰灬荷 阅读(83) 评论(0) 推荐(0) 编辑
摘要: content = input("请输入内容")if content == content[::-1]: print("这是一个回文句")else: print("这不是一个回文句") 阅读全文
posted @ 2019-05-28 06:40 冰灬荷 阅读(163) 评论(0) 推荐(0) 编辑
摘要: count = 0sum = 0while count < 100: if count == 88: count = count +1 continue # pass elif count %2 == 0: sum = sum - count else: sum = sum + count coun 阅读全文
posted @ 2019-05-28 06:39 冰灬荷 阅读(189) 评论(0) 推荐(0) 编辑
摘要: while True: choice = input("请选择A、B、C中的一个:") if choice == "A": print("走大路回家") T = input("选公交车还是步行:") if T == "公交车": print("10分钟后到家") break else: print( 阅读全文
posted @ 2019-05-28 06:38 冰灬荷 阅读(292) 评论(0) 推荐(0) 编辑
摘要: content = input("请输入内容:")sum = 0lst = content.split("+")for i in lst: sum = sum + int(i.strip())print(sum) 阅读全文
posted @ 2019-05-28 06:37 冰灬荷 阅读(180) 评论(0) 推荐(0) 编辑
摘要: content = input("请输入内容:")count = 0for i in content: if i.isdigit(): #判断是不是整数 count = count + 1print(count) 阅读全文
posted @ 2019-05-28 06:36 冰灬荷 阅读(141) 评论(0) 推荐(0) 编辑