jzjz54545454
jzjz54545454
全部文章
分类
题解(33)
归档
标签
去牛客网
登录
/
注册
jzjz54545454的博客
全部文章
(共31篇)
题解 | #删除字符串中出现次数最少的字符#
注意 list.count(list[i])函数:用于统计字符串里某个字符或子字符串出现的次数。 while True: try: s=list(input()) l=len(s) d={} ss='' for i in s...
2021-09-02
0
304
题解 | #字符串反转#
与数字颠倒方法相同 while True: try: s1=input() s1=list(s1) s=list(reversed(s1)) print("".join(s)) except: br...
2021-08-31
0
224
题解 | #数字颠倒#
注意: 1、reverse()函数: lista.reverse():这一步操作的返回值是一个None,需要通过打印被作用的列表才可以查看出具体的效果 reversed(sequence)->反转迭代器的序列值:返回序列值经过反转之后的迭代器,通过遍历或者List、next()等方法,获取作用...
2021-08-31
0
302
题解 | #字符个数统计#
注意:ord() 函数:返回字符的ASCII码 while True: try: st=input() s=list(st)#将字符串转为列表 temp=[]#保存字符串列表中出现的每种字符 for i in s: ...
2021-08-31
0
349
题解 | #进制转换#
注意:int()函数的用法,int(x,base) x有两种:str 或者 int 若x为纯数字,则不能有base参数,否则报错;其作用为对x取整 若x为str,则base可略可有,base存在时,视x为base类型数字,并将其转换为10进制数字 若x不符合base规则,则报错 while True...
2021-08-31
0
271
题解 | #字符串分隔#
注意 1、字符串数组的切片操作 2、重复输出多个字符:字符*出现的次数 while True: try: s=input() while(len(s)>=8):#字符串长度大于等于8 print(s[:8]) s=s...
2021-08-31
0
198
题解 | #记负均正#
while True: try: n=int(input()) count=0 for i in range(n+1):#注意应该包括n temp=str(i*i) if(temp.endswith(str(...
2021-08-24
0
215
题解 | #自守数#
while True: try: n=int(input()) count=0 for i in range(n+1):#注意应该包括n temp=str(i*i) if(temp.endswith(str(...
2021-08-24
0
172
题解 | #判断两个IP是否属于同一子网#
while True: try: mask=list(map(int,input().split("."))) ip1=list(map(int,input().split("."))) ip2=list(map...
2021-08-22
0
292
题解 | #字符串合并处理#
hex_num = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D',...
2021-08-15
0
387
首页
上一页
1
2
3
4
下一页
末页