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

推荐订阅源

WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Cloudbric
Cloudbric
P
Palo Alto Networks Blog
T
Threatpost
T
Tor Project blog
T
Tenable Blog
AWS News Blog
AWS News Blog
Project Zero
Project Zero
L
LangChain Blog
Cyberwarzone
Cyberwarzone
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
C
CERT Recently Published Vulnerability Notes
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Latest
Security Latest
云风的 BLOG
云风的 BLOG
I
Intezer
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
MongoDB | Blog
MongoDB | Blog
aimingoo的专栏
aimingoo的专栏
K
Kaspersky official blog
Jina AI
Jina AI
N
News | PayPal Newsroom
T
The Blog of Author Tim Ferriss
D
DataBreaches.Net
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
Recorded Future
Recorded Future
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Secure Thoughts
TaoSecurity Blog
TaoSecurity Blog
P
Privacy & Cybersecurity Law Blog
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
IT之家
IT之家
Forbes - Security
Forbes - Security
The Hacker News
The Hacker News
Last Week in AI
Last Week in AI
T
Threat Research - Cisco Blogs
Y
Y Combinator Blog

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自己做个博客,哈哈哈