zoukankan      html  css  js  c++  java
  • python--- if 语句

    #if-elif-else
    # int(input('请输入你的分数:'))
    grade = int(input('请输入你的分数:'))
    if grade -ge 90:
        print('优秀')
    elif grade -ge 70:
        print('良好')
    elif grade -ge 60:
        print('及格')
    else:
        print('不及格')
     
    '''
        多行注释''' '''
    '''
    #if 常用来判断用户登录时输入的用户名和密码是否正确
    #变量的命名定义规则:小写字母与下划线_小写字母

    account = 'huan'
    password = '123456'

    print('please input account')
    user_account = input()

    print('please input password')
    user_password = input()

    if account == user_account and password == user_password:
        print('success')
    else:
        print('failed')

    #注意:user_password = input()
    #用户名和密码是且的关系
    #account == user_account and password == user_password :
    #if 还可以嵌套if ,但是一般不建议嵌套,建议把if 下的嵌套语句封装成一个函数
    #代码块,缩进

    if condition:
        pass
    elif expression:
        pass
    else:
        pass

    a = 1
    b = 0 
    a or b


    当你的才化撑不起野心时,还是安静下来学习吧!
  • 相关阅读:
    ABAP TCode
    SAP 常用的事务代码
    SAP FI TCode
    Little Tutorials的一篇文章断言:UML(统一建模语言)正在死亡:
    SAP PP TCode
    [ZT]解密中国IT人十大职业现状
    User Exit Query
    SAP客户端多语言设置
    一个女CIO的诞生
    DIY防奸手册之 主流硬盘型号解惑篇
  • 原文地址:https://www.cnblogs.com/carl007/p/12013104.html
Copyright © 2011-2022 走看看