- 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.
推薦閱讀
- 零基礎PHP學習筆記
- R語言經典實例(原書第2版)
- INSTANT CakePHP Starter
- Hands-On JavaScript High Performance
- C語言程序設計實踐教程
- Hands-On Swift 5 Microservices Development
- Selenium Testing Tools Cookbook(Second Edition)
- 微服務架構深度解析:原理、實踐與進階
- Multithreading in C# 5.0 Cookbook
- Xcode 6 Essentials
- Applied Deep Learning with Python
- PHP Microservices
- Python無監督學習
- Computer Vision with Python 3
- Developing RESTful Web Services with Jersey 2.0