摘要: 加 + 减 - 乘 * 除 / 等 = 乘方 ** 取余 % 取整 // 包含 in name="凤凰传奇" if "凤凰" in name: print("<OK>") else: print("<error>") 不包含 not in name="凤凰传奇" if "龙" not in name 阅读全文
posted @ 2025-05-25 11:45 大猫学编程 阅读(12) 评论(0) 推荐(0)
摘要: count=0while count<3: user=input(">>>") pwd=input("<<<") if user=="damao" and pwd=="123": print("欢迎登录") break else: print("<账号密码错误,请重新输入>") count=coun 阅读全文
posted @ 2025-05-25 10:43 大猫学编程 阅读(10) 评论(0) 推荐(0)
摘要: 只要见到continue,就表示要返回到while的条件判断处,不会执行continue后面的代码,一句话总结:终止当前循环,返回循环开始,重新进行判断 count = 0 while count < 10 : count = count + 1 print(count) continue prin 阅读全文
posted @ 2025-05-25 10:22 大猫学编程 阅读(61) 评论(0) 推荐(0)