无名商城论坛

搜索
查看: 255|回复: 0

[其他技术] 【LSP】python输入密码的隐藏及判断语句

[复制链接]

1万

主题

1万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
32464
发表于 2022-5-8 17:04:03 | 显示全部楼层 |阅读模式



1 import getpass
2
3 username = input("username:")
4 password = input("password:")
5
6 if_username == username and _password == password:
7     print("welcome {name} login...", .format(name=username))
8 else:
9     print("Invalid username or password!")

使用python的内置模组来隐藏密码

判断年龄的小程序

age_of_girl = 16
guess_age = int(input(girl's age)

if guess_age == age_of_girl:
    print("you got it !")
elif guess_age >= age_of_girl:
    print("think smaller , you think is bigger. ")
else:
    print("think bigger , you think is smaller ")
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表