It ’s very rudimentary, I was addicted to python list concatenation, so I will summarize it.
There are two ways to connect.
listSample.py
hoge = ["1", "2"]
foo = ["3", "4"]
#NG that tends to be done: hoge.extend(foo)The return value of is None. Therefore NoneType has no len.
while len(hoge) < 10:
hoge = hoge.extend(foo)
# OK
while len(hoge) < 10:
hoge = hoge + foo
# OK
while len(hoge) < 10:
hoge.extend(foo)
Speed comparison for leisurely Python list addition (append, comprehension, etc.)