字符串 join split find strip upper lower replace max() min() in ord(字符转ASCI) chr(ASCIl转字符) len() for 索引 切片 +连接两个字符串 'a'+'b'='ab 占位符%s {} range(100) 字符串不可 ...
分类:
其他好文 时间:
2018-08-16 00:53:11
阅读次数:
115
from interface import user,shopping,bankfrom lib import commondef register(): while True: print('注册') inp_name=input('请输入用户名').strip() pwd=input('请输入密 ...
分类:
其他好文 时间:
2018-08-16 00:42:36
阅读次数:
149
本文转自阮一峰大神 【个人理解点:】 1. "任务队列"是一个事件的队列,只要事件指定过回调函数,这些事件完成任务时,就会向"任务队列"添加一个事件,等待主线程读取。 2. 当主线程执行完“执行栈”中的同步任务之后,去开始执行已经完成任务等待中的异步任务,执行的就是任务对应的回调函数 3. 主线程的 ...
分类:
编程语言 时间:
2018-08-15 20:36:50
阅读次数:
208
S.strip([chars])leading and trailingexample:my_str = '(d)d(d)))' -> 'd)d(d'
分类:
编程语言 时间:
2018-08-14 11:29:33
阅读次数:
175
整型 int 字符串 str 1 __author__ = "Tang" 2 3 """不要指望一下全背下来""" 4 """必会的:join split find strip upper lower replace""" 5 6 # capitalize() 首字母大写 7 a = 'tang' ...
分类:
编程语言 时间:
2018-08-13 23:46:22
阅读次数:
230
import timeuser,passwd = "gx","gx123"def auth(func): def wrapper(*args,**kwargs): username = input("username:").strip() password = input("password:"). ...
分类:
其他好文 时间:
2018-08-12 21:35:17
阅读次数:
118
字符串修改replace(old,new[,count])->str字符串中找到匹配替换为新子串,返回新字符串count表示替换几次,不指定就是全部替换原字符串为一个常量,不可变。修改返回的为新子串strip([chars])->str从字符串两端去除指定字符集chaars中的所有字符如果chars没有指定,去除两端的空白字符空白字符、就是指看不见的字符如\r\n\t空格空白字符,空串
分类:
编程语言 时间:
2018-08-12 19:59:55
阅读次数:
232
2.自定义函数:
语法:def 函数名(参数1,参数2,...):
‘‘‘注释信息‘‘‘
函数体
return #返回值
def auth():
name=input(‘name>>:‘).strip()
password=input(‘password>>:‘).strip()
if name == ‘abc‘ and password == ‘123‘:
print(‘login successfull‘)
else:
print(‘user or password err‘)
auth()
3.定义函数的三种形式:
(1):无参函数
(2):有参函数
(3):空函数
有参函数:
def auth(name,password):
if name == ‘abc‘ and password == ‘123‘:
print(‘login successfull‘)
else:
分类:
其他好文 时间:
2018-08-12 12:17:31
阅读次数:
149