摘要: # 非空即真,非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)
摘要: str.isalnum() 所有字符都是数字或者字母 str.isalpha() 所有字符都是字母 str.isdigit() 所有字符都是数字 str.islower() 所有字符都是小写 str.isupper() 所有字符都是大写 str.istitle() 所有单词都是首字母大写,像标题 s 阅读全文
posted @ 2018-06-05 16:09 liudna 阅读(76) 评论(0) 推荐(0)
摘要: # 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)