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
阅读全文
摘要: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
阅读全文
摘要:定义: 内置函数:Python中自带的函数,不需要定义,可以直接使用。 如: input() #接受输入 print() #打印 len() #取长度 type() #判断什么类型 str() #转为字符串 tuple() #把list转为元组 set() #转集合 dict() #转字典 list
阅读全文
摘要:import string, random all_num = [] def phone(): phone_number = input('请输入想要产生的条数:').strip() phone_number = int(phone_number) #转化为int for i in range(ph
阅读全文
摘要:如果所写的代码出问题了,可以使用断点来逐行调试,如图所示:
阅读全文