Skip to content

How to append a number to a list in Python?

l = [1, 2, 4, 5] 
new_item = 6
l.append(6)
print(l)
See also  How to add a fuction in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

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