`
m4774411wang
  • 浏览: 111867 次
  • 性别: Icon_minigender_1
  • 来自: 南昌
社区版块
存档分类
最新评论

python is

阅读更多

python is是种很特殊的语法,你在其它的语言应该不会见到这样的用法,今天就来说说这个把。
python is 按照自字面的意思就是什么东西是什么的,比如he is a boy,他是一个大男孩,而我们一般在写python程序的时候,也会用到一些判断,有的时候也会用到python is,比如判断下这个字符是否为none。

下面是python is的例子,比如我们来判断下一个字符串。
a = 'abc'

if a is not None:
print 'a is not none'

输出的结果是 a is not none

那现在就有个疑问了,什么时候会出现None,不然我们就不用python is来判断了。
一般在python里面我们的调用一些方法的话,会返回None,而不是其它的值,比如python 列表操作方法里面的python append()就是返回
None,其它的一些方法也会返回None,所以python is就有用武之地了。

最近大家都在玩人人网,我没事的时候也写了个python cookielib来实现一些小的功能,建议大家去看看!

原创文章请注明转载自老王python,本文地址:http://www.cnpythoner.com/post/101.html

 

 

作者:老王@python python 教程
老王python,提供python相关的python 书籍,python 主机,django 教程和python 下载,希望大家能够喜欢!

分享到:
评论

相关推荐

    Python 3.7 is a programming language

    Python is used in many application domains. Here's a sampling. The Python Package Index lists thousands of third party modules for Python. Web and Internet Development Python offers many choices for ...

    Python is a programming language that is interpreted, object-ori

    Python is a programming language that is interpreted, object-oriented, and considered to be high-level too

    Ubuntu/Deepin下Python3.8出现SSL错误的解决方案

    WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. 网上的方法都是在CentOS下进行的,而我用的是Deepin系统,也就是基于Ubuntu/Debian的发行版...

    Why Python is Slow: Looking Under the Hood

    Why Python is Slow: Looking Under the Hood # Why Python is Slow Python is slower than Fortran and C for a variety of reasons # Python meta-hacking: Don't take my word for it # Just for fun: a few ...

    Python Unlocked(PACKT,2015)

    Python is a versatile programming language that can be used for a wide range of technical tasks―computation, statistics, data analysis, game development, and more. Though Python is easy to learn, it...

    A personal budget tracker in Python is a software or application

    A personal budget tracker in Python is a software or application that helps you track your money inflow and outflow, and can also help yo…

    python is jiafa.py

    python入门

    Fluent Python 原版pdf by Ramalho

    “Python is an easy to learn, powerful programming language.” Those are the first words of the official Python Tutorial. That is true, but there is a catch: because the language is easy to learn and ...

    Python: Learn Python in 24 Hours: Complete Beginners Guide [2016]

    Python: Learn Python in 24 Hours: Complete Beginners Guide English | 19 July ... The biggest advantage of Python is that it is a free language, and anyone can change, correct or improve the algorithm.

    Clean Python.pdf

    Python is one of the most popular languages today. Relatively new fields such as data science, AI, robotics, and data analytics, along with traditional professions such as web development and ...

    Python Developer's Handbook

    The Python Developer’s Handbook is designed to expose experienced developers to Python and its uses. Beginning with a brief introduction to the language and its syntax, the book moves quickly into ...

    Programming in Python 3 Second Edition

    It is possible to create Python programs that use platform-specific functionality, but this is rarely necessary since almost all of Python’s standard library and most third-party libraries are fully...

    Python-IntroducingPython-Bill Lubanovic.pdf

    Python code is included early and often. Even though this is an introduction, I include some topics that might seem advanced, such as NoSQL databases and message-passing libraries. I chose these ...

    Python for Finance 2nd Edition

    These days, Python is undoubtedly one of the major strategic technology platforms in the financial industry. When I started writing the first edition of this book in 2013, I still had many ...

    Illustrated Guide to Python 3

    Illustrated Guide to Learning Python is designed to bring developers and others who are anxious to learn Python up to speed quickly. Not only does it teach the basics of syntax, but it condenses years...

    Mastering Python for Networking and Security

    Meanwhile, Python is being used for increasingly advanced tasks, with the latest update introducing many new packages. This book focuses on leveraging these updated packages to build a secure network...

    python pip3报没安装ssl module的解决办法_python3导入ssl报错

    python pip3报没安装ssl module的解决办法

    Numerical Methods In Engineering With Python

    Numerical Methods in Engineering with Python is a text for engineering students and a reference for practicing engineers, especially those who wish to explore the power and efficiency of Python. The ...

Global site tag (gtag.js) - Google Analytics