Python 3基础教程7-if语句

Posted on 2021-06-04 18:02  sesen  阅读(82)  评论(0编辑  收藏  举报

前面文章介绍的循环语句,这里开始介绍控制语句。直接看下面的demo.py例子

# 这里介绍 if语句
 
x = 5
y = 8
z = 4
s = 5
 
if x < y:
    print('x is less than y')
 
if x < y > z:
    print('x is less than y and greater than z')
 
if x <= s:
    print('x is less than or equal to s')

本文转自SDK社区:http://www.sdk.cn

Copyright © 2024 sesen
Powered by .NET 9.0 on Kubernetes