摘要: 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) 编辑
摘要: number = int(input("请输入数字:"))count = 2while count <= number -1: if number % count == 0: #质数是除了1和它本身能除尽。将这个数从2开始除,除到number-1,如果有除尽的就不是质数,如果没有就是质数。 prin 阅读全文
posted @ 2019-05-27 10:53 冰灬荷 阅读(211) 评论(0) 推荐(0) 编辑
摘要: ad = input("请输入广告语:")if ad.count("最") >=1 or ad.count("稀缺的") >= 1 or ad.count("第一") >= 1 or ad.count("国家级") >= 1 : print("广告语不合法")else: print("广告语合法") 阅读全文
posted @ 2019-05-27 09:38 冰灬荷 阅读(315) 评论(0) 推荐(0) 编辑
摘要: number = int(input("请输入数字:")) count = 1while number // 10**count > 0: count =count +1else: print("这是一个 %s 位数!" % count) while True: num = int(input("请 阅读全文
posted @ 2019-05-27 09:34 冰灬荷 阅读(3019) 评论(0) 推荐(0) 编辑