1. 首页
  2. 数据库
  3. 其它
  4. python if 语句

python if 语句

上传者: 2020-12-31 20:12:59上传 PDF文件 38.05KB 热度 18次
检查两个值是否相等, 用 == day = "sunny" if day == "sunny": //由于变量day的值是sunny,因此通过这条条件测序,python就会执行紧跟在if语句后面的代码块 print("Excellent") //输出结果为: Excellent 检查两个值不相等, 用!= day = "rainy" if day != "sunny": print("Sorry, you need to do one more time") //输出结果为: Sorry, you need to do one more time 使用and检查多个条件,如
下载地址
用户评论