#把字符串a='3[ab]acc',解压成‘abababacc’
a='3[ab]acc'
b = a.split(']')[0]
c = b.split('[')
d=int(c[0])*c[1]
e = d+a.a.split(']')[1]
print(e)
#把字符串a='3[ab]acc',解压成‘abababacc’
a='3[ab]acc'
b = a.split(']')[0]
c = b.split('[')
d=int(c[0])*c[1]
e = d+a.a.split(']')[1]
print(e)
本文标题:python-基础题目:字符串解压缩
本文链接:https://www.haomeiwen.com/subject/aukqnttx.html
网友评论