每天努力一点点,坚持下去 ------ 博客首页

03 2020 档案

摘要:#1、必须只有一个小数点 #2、小数点的左边必须是整数,小数点的右边必须是正整数 def is_float1(s=None): s = str(s) #.1 if s.count('.')==1: left,right = s.split('.') #['-','1'] if left.isdigi 阅读全文
posted @ 2020-03-29 11:18 他还在坚持嘛 阅读(1708) 评论(0) 推荐(0) 编辑
摘要:import time users = {} time = time.strftime('%Y-%m-%d %H:%M:%S') with open('user.txt')as fr: for line in fr: if line.strip(): user,password = line.spl 阅读全文
posted @ 2020-03-28 17:25 他还在坚持嘛 阅读(254) 评论(0) 推荐(0) 编辑
摘要:定义: 内置函数:Python中自带的函数,不需要定义,可以直接使用。 如: input() #接受输入 print() #打印 len() #取长度 type() #判断什么类型 str() #转为字符串 tuple() #把list转为元组 set() #转集合 dict() #转字典 list 阅读全文
posted @ 2020-03-22 15:20 他还在坚持嘛 阅读(284) 评论(0) 推荐(0) 编辑
摘要:import string, random all_num = [] def phone(): phone_number = input('请输入想要产生的条数:').strip() phone_number = int(phone_number) #转化为int for i in range(ph 阅读全文
posted @ 2020-03-21 20:05 他还在坚持嘛 阅读(566) 评论(0) 推荐(0) 编辑
摘要:如果所写的代码出问题了,可以使用断点来逐行调试,如图所示: 阅读全文
posted @ 2020-03-17 21:40 他还在坚持嘛 阅读(224) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示