码迷,mamicode.com
首页 > 编程语言 > 详细

python之if,while,for

时间:2018-12-14 22:59:03      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:语句   mil   size   mon   for   输入   back   code   NPU   

  • if Python 编程中 if 语句用于控制程序的执行,基本形式为:
  • #Author:wereWolf
    """
    if
    的三种表现形式
    1 if
    2 if else
    3 if elif
    else
    4 if
    pass
    """
    age = int(input("
    请输入您的年龄:"))
    if age > 18:
    print("
    你可以泡妞了")
  • ###################################
  • age = int(input("请输入您的年龄:"))
    if age > 18:
    print("
    你可以泡妞了")
    else:
    print("
    孩子你年龄还小")

######################################

  • age = int(input("请输入您的年龄:"))
    money = int(input("
    请输入您年薪"))
    hight = input("
    请输入高吗")
    if age<23 and money>300000 and hight == "
    ":
    print("
    您是高富帅")
    else:
    print("
    穷屌丝")

 

python之if,while,for

标签:语句   mil   size   mon   for   输入   back   code   NPU   

原文地址:https://www.cnblogs.com/blackBrock/p/10121756.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!