摘要: #coding=utf-8 #1. 将字符串 "abcd" 转成大写 #2. 计算字符串 "cd" 在 字符串 "abcd"中出现的位置 #3. 字符串 "a,b,c,d" ,请用逗号分割字符串,分割后的结果是什么类型的? #4. "{name}喜欢{fruit}".format(name="李雷" 阅读全文
posted @ 2022-11-07 17:31 家乐福的搬砖日常 阅读(370) 评论(0) 推荐(0) 编辑
摘要: #coding=utf-8; #1.字符串与int相互转换 a=100; b=str(a); c="200"; d=int(c); print type(a),a,type(b),b,type(c),c,type(d),d; #2.字符串与float相互转换 a1=1.23 b1=str(a1); 阅读全文
posted @ 2022-11-07 15:43 家乐福的搬砖日常 阅读(54) 评论(0) 推荐(0) 编辑
摘要: #coding=utf-8 #1.startswith(prefix[, start[, end]]) 检查字符串是否是以指定子字符串 prefix 开头 print "abcefg".startswith("abc"); #2.endswith 检查字符串是否以 suffix 结束 print " 阅读全文
posted @ 2022-11-07 14:58 家乐福的搬砖日常 阅读(28) 评论(0) 推荐(0) 编辑
摘要: #coding=utf-8; #1.python字符串的count方法返回子串sub在字符串中出现的次数,通过start和end参数可以设置统计的起始索引和结束索引,如果子串不存在就返回0 print "lolo".count("o"); #2.python字符串的find方法用于查找子串在字符串中 阅读全文
posted @ 2022-11-07 14:21 家乐福的搬砖日常 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 1.docker的 常用命令 包含docker的查看服务状态,启动,停止,开机自启动,重启。 1.1 查看docker服务的状态 systemctl status docker docker处于启动的状态:Active: active (running) since 日 2023-09-24 18: 阅读全文
posted @ 2022-11-07 14:02 家乐福的搬砖日常 阅读(174) 评论(0) 推荐(0) 编辑