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

推荐订阅源

S
Schneier on Security
F
Fortinet All Blogs
B
Blog
GbyAI
GbyAI
P
Proofpoint News Feed
量子位
The Register - Security
The Register - Security
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
B
Blog RSS Feed
WordPress大学
WordPress大学
Recorded Future
Recorded Future
Recent Announcements
Recent Announcements
V
Vulnerabilities – Threatpost
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Secure Thoughts
雷峰网
雷峰网
Stack Overflow Blog
Stack Overflow Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Webroot Blog
Webroot Blog
AWS News Blog
AWS News Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The GitHub Blog
The GitHub Blog
爱范儿
爱范儿
O
OpenAI News
月光博客
月光博客
H
Hacker News: Front Page
S
Security Affairs
W
WeLiveSecurity
The Hacker News
The Hacker News
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Help Net Security
Help Net Security
MongoDB | Blog
MongoDB | Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Docker
T
The Blog of Author Tim Ferriss
Spread Privacy
Spread Privacy
Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
S
Securelist
Microsoft Azure Blog
Microsoft Azure Blog
TaoSecurity Blog
TaoSecurity Blog
T
Threat Research - Cisco Blogs
M
MIT News - Artificial intelligence
A
About on SuperTechFans

网站相关 on 老刘博客

用lnmp安装thinkphp类的程序,文件夹没有权限 Django设置使用MySql的时候遇到的一些坑 RackNerd的2022年黑五活动 改用cloudcone的VPS 加入51la的优站计划 群晖安装trilium笔记web端不刷新的处理方法 开始使用Argon主题 更换为Dragon主题 Django部署在debian11服务器 试用荷兰的liteserverVPS python开发web程序,最好还是在Linux下 转到virmach 几种Linux系统安装之后的体验 被百度劲风算法搞了 放弃百度小程序 crmeb商城后台标题修改方法 RSS终于又搞好了 RackNerd的6.18活动出来了 重新弄了下博客环境 试用urlos 捡漏注册了个l22.org的域名 把域名从阿里云转出到name.com的方法 博客web端改用apache nginx使用CDN后获取用户真实IP的方法 流金岁月启用新域名 停止使用RSS Feed 纯代码设置frp服务器 网站换了一台服务器 nodecache开通了中国直连线路 从宝塔面板换成oneinstack踩的一个坑 腾讯的CDN还是可以的 解决升级PHPmake: *** No rule to make target `install’. Stop.的问题 推荐篱落主机的香港VPS 网站被黑了? 换篱落的空间,用宝塔面板,CSRF校验失败 博客更换到阿里云香港轻量,并升级到wordpress5.3.0 再说说景安的服务 给7b2的主题加上评论回复功能 备忘,使用阿里云ossfs备份网站 记一次因为标点符号导致重装服务器的经历 利用cloudFlare的边缘计算workers实现外链转内链跳转 Godaddy可以用微信管理域名 wordpress自动升级到5.2.2 xshell6更新至0125 7b2主题每日签到不刷新的解决办法 推荐一款国外CDN——Nodecache,注册即送1T流量 上海云盾CDN简要设置指南 7b2主题添加百度是否收录及禁止非管理员访问后台 新浪SAE文件管理及防盗链的设置 配置WP-Mail-SMTP的技巧 只需三步,让你的wordpress在godaddy免费空间上完美呈现
用input和字典初步实现我的一点小想法
老刘 · 2021-10-30 · via 网站相关 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自己做个博客,哈哈哈