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

python-if判断

时间:2019-04-14 15:59:43      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:输入   coding   print   pytho   and   guess   name   NPU   port   

# -*- coding:utf-8 -*-
# Author:DliYao
import getpass
‘‘‘
_username = "dengliyao"
_password = "dly"

username = input("username: ")
#password = getpass.getpass("password: ")
password = input("password: ")

if _username == username and _password == password:
print("{name}...登陆成功".format(name=username))
else:
print("用户名或密码错误")

‘‘‘


#用户输入一个年龄进行判断

age_of_oldboy = 20
guess_age = int(input("guess age: "))

if guess_age == age_of_oldboy:
print("正确")
elif guess_age > age_of_oldboy:
print("大了")
else:
print("小于")

python-if判断

标签:输入   coding   print   pytho   and   guess   name   NPU   port   

原文地址:https://www.cnblogs.com/dliy/p/10705175.html

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