python
嗯,起个什么名字好呢
这个作者很懒,什么都没留下…
展开
-
python 查找字符串中最长的数字子串 PTA
import re def find(s): max = 0 count = 0 end = 0 if bool(re.search(r'\d', s))==False: print('No') else: for i in range(len(s)): if (s[i] >= '0' and s[i] <= '9'): count += 1 .原创 2022-04-29 00:31:23 · 2877 阅读 · 0 评论 -
(python) 有关 for x in b print(b)的问题
a='0123456789' b=list(a) for x in b: print(b) #注意是b,不是a 运行结果: D:\python\python.exe C:/Users/25090/PycharmProjects/pythonProject/venv/1.py ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] ['0', '1', '2原创 2022-04-08 18:01:13 · 485 阅读 · 0 评论