摘要: 提示猜年龄,猜对了结束,猜错继续猜,猜错三次,提示要不要继续 count = 0 while True: v1 = int(input("请输入一个数字:")) if v1 == 20: print("恭喜你猜对了!!!") break elif v1 < 20: count += 1 print( 阅读全文
posted @ 2022-08-02 15:00 A阿林 阅读(34) 评论(0) 推荐(0)
摘要: bool值、startswith判断是否有该字符串开头 v1 = int(input("请输入一个数字:")) #比较产生bool值 v2 = (v1 == 9) while v2: print("cool") print("cool" == "cool") v1 = "" v2 = bool(v1 阅读全文
posted @ 2022-08-02 14:57 A阿林 阅读(28) 评论(0) 推荐(0)