摘要: 知识点 数据类型转化 代码 n=list(input())#string转list print(len(n),end= " ") n= map(int,n)#将list里面的元素转为int类型 ans=0 for i in n: ans+=i print(ans) 阅读全文
posted @ 2022-05-28 17:23 kingwzun 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 做法1:使用re.findall import re n=int(input()) k=input() cnt=format(n,"x") t=re.findall(k,cnt) print(len(t)) 做法2:朴素做法 n=int(input()) k=input() cnt=format(n 阅读全文
posted @ 2022-05-28 16:16 kingwzun 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 知识点: re正则表达式的使用‘ list转string string转数字 进制转化 代码: import re str=input() match = re.findall('[0-9a-fA-F]', str) str=''.join(match) str=str.lower() ans10= 阅读全文
posted @ 2022-05-28 11:40 kingwzun 阅读(63) 评论(0) 推荐(0) 编辑