if_else

Posted

tags:

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

判断一个用户,密码是否对


#!/usr/bin/env python

# -*- coding:utf-8 -*-

_username="Lucky"

_password="123"

username=input("username:")

password=input("password:")

if _username==username and _password==password:

    print("welcome to login system!")

else:

    print("invalid username or password!")


2.结果如图:

技术分享

本文出自 “Lucky33” 博客,谢绝转载!

以上是关于if_else的主要内容,如果未能解决你的问题,请参考以下文章