Wenyu's Blog
Wenyu's Blog


  • 首页

  • 分类

  • 博文归档

  • 标签云

  • 搜索
close
Python

【Python Trick】判断字符串是否为空

发表于 2017-11-16

【Python Trick】判断字符串是否为空

发表于 2017-11-16   |   分类于 Python
str=''

if str.strip()=='':
print('str is null')

if not str.strip():
print('str is null')

str='hello'
if str.strip():
print('str is not null')
#Python
【Python Trick】set与list
【汽车口碑分析】1.Ubuntu 16.04 LTS下安装Scrapy
  • 文章目录
  • 站点概览

78 日志
18 分类
40 标签云
RSS
GitHub
Creative Commons

此文章未包含目录

© 2017 - 2018
由 Hexo 强力驱动
主题 - NexTD