None
0 值的整型 / 浮点型、空字符串('')、空列表([])、 空元组((,))、空字典({})、空集合(set())都等价于 False,但是不等于 None
thing = None
if thing:
print("It's some thing")
else:
print("It's no thing") if thing is None:
print("It's no thing")
else:
print("It's some thing")
随机推荐
- windows 下c++编译
http://blog.csdn.net/dyllove98/article/details/9314993
- CSS function--功能样式
功能样式,从常用样式方法中抽离,按需使用,使用前请先阅读 CSS规范 中相关条列. /* function */ .f-cb:after,.f-cbli li:after{display:block; ...
- Maven开源中国镜像
mirrors> <mirror> <id>nexus-osc</id> <mirrorOf>central</mirrorOf> ...
- E-R图向关系模式的转换
转自: http://hi.baidu.com/qicaiqinxian/blog/item/a8bb0bdf31ae081b63279887.html E-R图向关系模型转换时犯糊涂了,找到下面这篇 ...
- [设计模式] 22 模板方法模式 template
转http://www.jellythink.com/archives/407 在GOF的<设计模式:可复用面向对象软件的基础>一书中对模板方法模式是这样说的:定义一个操作中的算法骨架,而 ...
- Java学习第七篇:与运行环境交互
目录 一.与用户互动 1.main方法形参 2.使用Scanner类获取输入 3.使用BufferedReader类获取输入 二.常用类 1.System类和Runtime类 2.String, St ...
- (转)开源爬虫larbin分析
转自风中之炎的博客:http://www.cnblogs.com/FengYan/archive/2012/02/04/2338630.html 1. larbin简介(百度百科) larbin是一种 ...
- C#图片上写文字
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Dr ...
- java基础知识回顾之javaIO类--File类应用:删除带内容的目录
/** * 深度删除一个带内容的目录 * 原理:必须从里往外删除,需要深度遍历 * @author Administrator * */ public class FileDeleteList { / ...
- hdu 3972 1 M possible
一般做法: 显然的超内存 #include<stdio.h> #include<algorithm> using namespace std; ],ans[]; int mai ...