https://www.runoob.com/python/python-strings.html
rsplit反向分割 从右边分割 1
pythons = 'das dsa 123'
print(s.rsplit(' ',1))
outpuut:['das dsa', '123']
pythonres=[1,2,3]
print("-".join(map(str, res))+"end")
pythonrawstr = input()
res = []
for i in rawstr[::-1]: # 反向遍历
if int(i) not in res:
res.append(int(i))
print("".join(map(str,res)))
用列表反向
pythona=list(input())
a.reverse()
print("".join(a))
反向遍历
pythona = input()
res = ""
for i in a[::-1]:
res += i
print(res)
pythonwhile True:
try:
line = input()
a = 0
b = 0
c = 0
d = 0
flag = True
for i in line:
if i.isdigit():
a = 1
elif i.islower():
b = 1
elif i.isupper():
c = 1
else:
d = 1
for j in range(len(line) - 3):
if line.count(line[j:j + 3]) > 1:
flag = False
if len(line) > 8 and (a + b + c + d) >= 3 and flag:
print("OK")
else:
print("NG")
except:
break
https://blog.csdn.net/qq_35085863/article/details/78188286
print(format(1, 'b').rjust(4, '0'))
本文作者:Dong
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC。本作品采用《知识共享署名-非商业性使用 4.0 国际许可协议》进行许可。您可以在非商业用途下自由转载和修改,但必须注明出处并提供原作者链接。 许可协议。转载请注明出处!