_username='qi'
_password='abc123'
username=input("username:")
password=input('password:')
if _username==username and _password==password:
print("welcome user {name}...".format(name=username))
else:
print('Invalid username or password!') print('finish')#前边顶格,不管执行if,还是else都会这行这一步,因为这一步和上一步没有因果关系,只有顺序关系

  

python_6_if的更多相关文章

随机推荐

  1. 51nod1024(math+set)

    题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1024 题意:中文题诶- 思路:要是能求出a^b的值来就好了. ...

  2. Idea设置签名

    IntelliJ IDEA如何设置头注释,自定义author和date   下面这张图,保证你一看就会: 下面这个模板,你拿去改一改就行了. 1 /** 2 * @Author: Gosin 3 * ...

  3. Jmeter 添加CSV Data set config 文件的相对路径及编码在Windows和Linux下的兼容性(转)

    简介: Jmeter实际上是不需要安装的,只需要有ApacheJMeter.jar.启动批处理文件(jmeter.bat或jmeter).配置文件(jmeter.properties.user.pro ...

  4. day04 ---Linux安装Python3

    如何linux上安装python3 1.下载源代码,方式有2个, 1.在windows上下载,下载完成后,通过lrzsz工具,或者xftp工具,传输到linux服务器中 2.在linux中直接下载 c ...

  5. Github网站css加载不出来的处理方法(转,亲测有效)

    转载链接:https://blog.csdn.net/qq_36589706/article/details/80573008因为工作需求,自己会经常使用到github,但是突然有一天打开github ...

  6. sysbench压力测试总结

    sysbench压力测试工具简介sysbench是一个开源的.模块化的.跨平台的多线程性能测试工具,可以用来进行CPU.内存.磁盘I/O.线程.数据库的性能测试.目前支持的数据库有MySQL.Orac ...

  7. Polycarp's Pockets(思维)

    Polycarp has nn coins, the value of the ii-th coin is aiai. Polycarp wants to distribute all the coi ...

  8. springBoot集成web service

    转载大神: https://blog.csdn.net/u011410529/article/details/68063541?winzoom=1 https://blog.csdn.net/nr00 ...

  9. chapter03

    import scala.collection.mutable.ArrayBuffer /** * Created by EX-CHENZECHAO001 on 2018-03-29. */class ...

  10. 11 Lists

    1       Lists 1.1  定义并访问Lists List list = new List[].也可以使用泛型.访问list中的元素,可以使用list.get(i) or list[i]. ...