摘要: a='*q*w*e*' print(a.strip('*'))去除首尾 * print(a.lstrip('*'))去除左边 * print(a.rstrip('*'))去除右边 * 阅读全文
posted @ 2021-03-04 11:27 火烧火燎 阅读(46) 评论(0) 推荐(0)
摘要: 这这个东西以后肯定会经常用的 ,先保存 ,用的多了就会了 阅读全文
posted @ 2021-03-04 10:54 火烧火燎 阅读(65) 评论(0) 推荐(0)
摘要: is 比较字符串儿 是否一样 使用格式 (变量 )is(变量 ) id 查询变量的地址 使用格式 id(变量 ) in 查询字符串中是否有某一个字符 使用格式 ('字符串儿' )in变量 阅读全文
posted @ 2021-03-04 10:42 火烧火燎 阅读(67) 评论(0) 推荐(0)
摘要: import time 导入时间模块 time01 = time.time()起始时间 a=('') for i in range(10000000): a += "qwe" time02 = time.time()结束时间 print("shijin"+str(time02-time01))str 阅读全文
posted @ 2021-03-03 16:49 火烧火燎 阅读(141) 评论(0) 推荐(0)
摘要: a=('qw e e ff fc ') print(a.split('f'))括弧 里边儿有东西 ,测以括号里边儿的东西为字符分号 print(a.split())括弧里边儿没有东西 ,此以逗号为 不分号 print(a[: -3]) a=('ww','ryy','tyu','hjjj') prin 阅读全文
posted @ 2021-03-03 14:42 火烧火燎 阅读(86) 评论(0) 推荐(0)
摘要: a ='qwerty' a=a.replace('w','*')replace——实现了w和*的转换 print(a)打印出来的是这个'q*erty' 阅读全文
posted @ 2021-03-02 19:37 火烧火燎 阅读(37) 评论(0) 推荐(0)
摘要: 1 sw=int(input('suiweishuo:')) 2 gw = sw%10个位数 3 sw =sw%100//10十位数 4 bw =sw//100%10百位数 5 qw =sw//1000千位数 6 print()四位数相加 ,怎样让四位数相加自己想办法 阅读全文
posted @ 2021-03-02 16:34 火烧火燎 阅读(366) 评论(0) 推荐(0)
摘要: xm=input("xm:") nl=input("nl:") xb=input("xb:") sg=input("sg:") grxx=f''' ~~~~~~我的个人信息~~~~~~ 姓名 :{xm} 年龄 :{nl} 性别 :{xb} 身高 :{sg} ~~~~~~结束~~~~~~ ''' pr 阅读全文
posted @ 2021-03-02 12:19 火烧火燎 阅读(217) 评论(0) 推荐(0)
摘要: cs = 0 while cs <=10: cs += 1 print(f"{cs}") 阅读全文
posted @ 2021-03-02 12:18 火烧火燎 阅读(40) 评论(0) 推荐(0)
摘要: for i in range(9): print(i) #exit 结束程序 阅读全文
posted @ 2021-03-02 12:16 火烧火燎 阅读(26) 评论(0) 推荐(0)