- 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.
推薦閱讀
- Learning Java Functional Programming
- C++ 從入門到項目實踐(超值版)
- 手把手教你學C語言
- concrete5 Cookbook
- Java EE 8 Application Development
- Learning Probabilistic Graphical Models in R
- 常用工具軟件立體化教程(微課版)
- Babylon.js Essentials
- 區塊鏈技術進階與實戰(第2版)
- 小型編譯器設計實踐
- 計算機應用基礎項目化教程
- 算法圖解
- OpenCV 3.0 Computer Vision with Java
- 實戰Python網絡爬蟲
- Swift High Performance