会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
liudna
博客园
首页
新随笔
联系
管理
订阅
2018年6月7日
字典
摘要: # 非空即真,非0即真# 实现同样的功能,代码越少越牛逼# a = []# b = 'niuhanyang' #not的意思是取反# c = ()# d = 0# e = None# if d:# print('是真的')# else:# print('是假的')# age name sex add
阅读全文
posted @ 2018-06-07 14:44 liudna
阅读(101)
评论(0)
推荐(0)
2018年6月5日
判断
摘要: str.isalnum() 所有字符都是数字或者字母 str.isalpha() 所有字符都是字母 str.isdigit() 所有字符都是数字 str.islower() 所有字符都是小写 str.isupper() 所有字符都是大写 str.istitle() 所有单词都是首字母大写,像标题 s
阅读全文
posted @ 2018-06-05 16:09 liudna
阅读(76)
评论(0)
推荐(0)
2018年6月3日
读取文件
摘要: # 1、打开文件# 2 、对他读/或者写#3、关闭文件# open() file()#1、有没有清空以前的内容#2、能不能读到东西#3、文件不存在的时候会不会报错f = open(r'haha.txt','a+',encoding='utf-8')# print('read', f.read() )
阅读全文
posted @ 2018-06-03 21:59 liudna
阅读(88)
评论(0)
推荐(0)
公告