惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
H
Heimdal Security Blog
K
Kaspersky official blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
Schneier on Security
G
GRAHAM CLULEY
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
CERT Recently Published Vulnerability Notes
Google DeepMind News
Google DeepMind News
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
C
Cisco Blogs
Cyberwarzone
Cyberwarzone
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
Security Archives - TechRepublic
Security Archives - TechRepublic
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 司徒正美
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
V
Visual Studio Blog
博客园 - Franky
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
Jina AI
Jina AI
P
Proofpoint News Feed
P
Proofpoint News Feed
有赞技术团队
有赞技术团队
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
Spread Privacy
Spread Privacy
Application and Cybersecurity Blog
Application and Cybersecurity Blog
IT之家
IT之家
S
Security Affairs
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
N
News | PayPal Newsroom
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
NISL@THU
NISL@THU

Python on 老刘博客

Django部署在debian11服务器 python开发web程序,最好还是在Linux下
用input和字典初步实现我的一点小想法
老刘 · 2021-10-30 · via Python on 老刘博客

从决心要学Python开始,到现在差不多一周的时间了吧,买了一本《Python编程,从入门到实践》的书,目前看到了第九章,函数篇。

通过上面8章的学习,基本上有了实现我那个小项目的想法。今天根据前八章的知识,初步用input函数,实现了用特殊关键字的查询。继续加油。

kehu = {
	'张明':{
		'右眼度数':'-1.25',
		'左眼度数':'-2.00',
		'瞳距':'60mm',
		'镜架':'纯钛',
		'镜片':'康耐特',
		'价格':'¥450',
		'手机号码':'13027511600',
	},
}
xingming = input("请输入你的姓名:")
shoujihaoma = input("请输入你的手机号码:")
for name , info in kehu.items():
	if name == xingming and info['手机号码'] == shoujihaoma:
		right = f"{info['右眼度数']}"
		lift = f"{info['左眼度数']}"
		tongju = f"{info['瞳距']}"
		jingjia = f"{info['镜架']}"
		jingpian = f"{info['镜片']}"
		jiage = f"{info['价格']}"
print("验光单")
		print(f"姓名:{name}")
		print(f"右眼度数:{right} 左眼度数:{lift}")
		print(f"瞳距:{tongju} ")
	else:
		print("您输入的资料不正确,请重新输入")

虽然简单,确实独立写出来的,应该是一大步吧。

学好了,用python自己做个博客,哈哈哈