Answers for "when we use array in python"

33

how to create an array in python

array = ["1st", "2nd", "3rd"]
#prints: ['1st', '2nd', '3rd']
array.append("4th")
#prints: ['1st', '2nd', '3rd', '4th']
Posted by: Guest on November-28-2019
2

array python

#create array
list = [1, 2, 3, 4, 5] 
  
#loop through an array
for i in list: 
    print(i)
Posted by: Guest on December-19-2020

Code answers related to "when we use array in python"

Python Answers by Framework

Browse Popular Code Answers by Language