Comments (3)
在第九节的查找/替换value中“判断存在某个key”部分,所提到的这两个代码和搭配起来的实例我看不懂。
示例中的input: d.get('陈二','此人不存在')
output: '此人不存在'我懂,就是返回'陈二'这个指定键的值吧?但 d.get('key'),return None 这个代码我没看明白,我自己输入的结果是这样
网上搜索了get()函数的示意也没怎么懂,可以麻烦解释一下,并且附上实例吗?(我知道这个问题很白痴,但真心求解,拜托了)
get(“陈二","此人不存在") 意思因该是查找键为陈二的值,如果没有陈二这个键就返回”此人不存在“
from girls-in-ai.
在第九节的查找/替换value中“判断存在某个key”部分,所提到的这两个代码和搭配起来的实例我看不懂。
示例中的
input: d.get('陈二','此人不存在')
output: '此人不存在'我懂,就是返回'陈二'这个指定键的值吧?
但 d.get('key'),return None 这个代码我没看明白,我自己输入的结果是这样
网上搜索了get()函数的示意也没怎么懂,可以麻烦解释一下,并且附上实例吗?
(我知道这个问题很白痴,但真心求解,拜托了)get(“陈二","此人不存在") 意思因该是查找键为陈二的值,如果没有陈二这个键就返回”此人不存在“
那请问get('key'),return None的意思呢?我后来用代码输了一下,是这样的
又该怎么理解?
谢谢了!
from girls-in-ai.
小姐姐写的get('陈二'),return None的意思是type(get('陈二'))这个是NoneType
from girls-in-ai.
Related Issues (20)
- 这是没有更新了吗 HOT 1
- [Pandas Day-23]titanic.csv原始数据那里来? HOT 1
- 如何成为一名AI算法工程师 链接建议优化 HOT 3
- 我们翻译了 data-science-ipython-notebooks
- jupyter创建python时错误:Creating Notebook Failed 、An error occurred while creating a new notebook. HOT 1
- mac配置环境变量出错导致终端无法键入任何字符
- [ml-day-1]jupyter notebook无法连接到python,程序无法运行
- day-22 值没有明确
- 环境设置不成功 HOT 1
- [Pandas day23]:下载了数据集之后并没有titanic.csv
- 装好的Anaconda,用create创建了一个3.6的环境,为什么只能打开Terminal和Python,IPython和Jupyter无法选择? HOT 1
- [ad]似懂非懂
- 转义字符语法错误 EOL while scanning string literal HOT 1
- ERROR in ./src/css/nomal.css HOT 1
- [issue] this is s test HOT 7
- test HOT 3
- py-Bob HOT 4
- CIBERSORTx group-mode : Error: $ operator is invalid for atomic vectors HOT 4
- The problem in solving nonlinear dynamic problem with Newmark-Beta & Newton-raphson method. How to solve the problem efficiently with a converged solution and with any time step. HOT 3
- Blonde HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from girls-in-ai.