条件判断与缩进

发布时间:2020-07-24 15:29:14 作者:pengchunboke
来源:网络 阅读:345
#/usr/bin/env python
sex = input("please input your sex:")
if sex == "girl":
    print("alex is 1b") ==>空格表示缩进,表示一个域,官方建议四个空格
elif sex == "man":
    print("alex is 2b")
else:
    print("alex is 3b")
运行时出现:
please input your sex:girl
alex is sb

please input your sex:man
alex is 2b

 please input your sex:ddgrdgg

 alex is 3b


推荐阅读:
  1. shell 条件判断
  2. thinkphp-条件判断-范围判断-in与else

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

please

上一篇:将spyder编辑区背景颜色改变的方法

下一篇:用spyder运行.py文件的方法

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》