python中字符串方法 name = "I teased at life as if it were a foolish game" print(name.capitalize())#首字母大写 print(name.count("a"))#查找字符串中a的个数 print(name.center(50,"-"))#长度为50将name放中间不够的用-补全 print(name.endswith("ex"))#字符串是否以e…
排序: 1:整理顺序 #冒泡 lista = [5,7,11,19,99,63,3,9,1] list = [] while lista != []: number = 0 for i in lista: if number < i: number = i lista.remove(number) list.append(number) print(list) 打印结果: D:\untitled\1\venv\Scripts\python.exe D:/untitled/1/venv/main.…