Skip to content

Python code snippet – How to add item to a list ?

#append to list
lst = [1, 2, 3]
something = 4
#lst is now [1, 2, 3, 4]
See also  Java code snippet - How to use random bound on doubles ?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.