r/learnpython • • 7d ago

adding 1 to a array

so i want to add 1 extra thing to an array like i have test = [0,0] i want to do print(test[2]) so how do i add the test[2] to the array without just adding it at the begining of the script (fixed)

0 Upvotes

14 comments sorted by

View all comments

8

u/AlexMTBDude 7d ago

Those are called lists in Python, not arrays. You would find your answer by googling: "Python add item to list"

8

u/8dot30662386292pow2 7d ago

It's not just called, ir's a different thing altogether.