python之if,while,for

Posted blackbrock

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python之if,while,for相关的知识,希望对你有一定的参考价值。

  • 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的主要内容,如果未能解决你的问题,请参考以下文章