sladesha's recent timeline updates
attend Tencent competition
Sep 2, 2019
start java
Sep 2, 2019
sladesha

sladesha

V2EX member #434360, joined on 2019-08-07 11:07:08 +08:00
sladesha's recent replies
Sep 5, 2019
Replied to a topic by songdg Python 请教如何判断一个列表中有多少个列表
def test(l):
ans = 0
def getListNumber(l):
nonlocal ans
for item in l:
if isinstance(item, list):
ans += 1
getListNumber(item)
return ans
return getListNumber(l)

if __name__ == '__main__':
List = [[1, 2, [3, [2], [1, 2]]]]
print(test(List))
a[-1:-1] = b 即可
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2510 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 11:10 · PVG 19:10 · LAX 04:10 · JFK 07:10
♥ Do have faith in what you're doing.