- Hands-On Data Science and Python Machine Learning
- Frank Kane
- 78字
- 2021-07-15 17:15:03
The if statement
print (1 is 3)
The output of the previous code is as follows:
False
The other thing we can do is use is, which is sort of the same thing as equal. It's a more Python-ish representation of equality, so 1 == 3 is the same thing as 1 is 3, but this is considered the more Pythonic way of doing it. So 1 is 3 comes back as False because 1 is not 3.
推薦閱讀
- Node.js+Webpack開發(fā)實戰(zhàn)
- Mastering Entity Framework Core 2.0
- DevOps with Kubernetes
- Mobile Application Development:JavaScript Frameworks
- Python網(wǎng)絡(luò)爬蟲從入門到實踐(第2版)
- 網(wǎng)絡(luò)爬蟲原理與實踐:基于C#語言
- Instant Ext.NET Application Development
- Learning OpenCV 3 Computer Vision with Python(Second Edition)
- Qt5 C++ GUI Programming Cookbook
- 數(shù)據(jù)分析與挖掘算法:Python實戰(zhàn)
- 面向?qū)ο蟪绦蛟O(shè)計及C++(第3版)
- Functional Python Programming
- PHP動態(tài)網(wǎng)站開發(fā)實踐教程
- HTML5+CSS3+jQuery Mobile+Bootstrap開發(fā)APP從入門到精通(視頻教學(xué)版)
- Mastering React Test:Driven Development