How to add an item to the end of a list in Python

1 Answer

0 votes
lst = [1, 2, 3, 4]

print(lst)

lst.append(5)

print(lst)



'''
run:
  
[1, 2, 3, 4]
[1, 2, 3, 4, 5]
  
'''

 



answered Jun 23, 2020 by avibootz

Related questions

1 answer 158 views
1 answer 185 views
1 answer 185 views
1 answer 160 views
160 views asked Jan 10, 2021 by avibootz
1 answer 174 views
1 answer 131 views
...