Post History
Use a+=[b] instead of a.append(b) The title says it all. a=[];b=10;print(a) a+=[b];print(a) Try it online!
#1: Initial revision
# Use `a+=[b]` instead of `a.append(b)`
The title says it all.
<!-- language-all: lang-python -->
a=[];b=10;print(a)
a+=[b];print(a)
[Try it online!][TIO-ktgijmli]
[Python 3]: https://docs.python.org/3/
[TIO-ktgijmli]: https://tio.run/##K6gsycjPM/7/P9E2OtY6ydbQwLqgKDOvRCNRkytR2zY6KRbO//8fAA "Python 3 – Try It Online"
