Answers for "arrays python"

20

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
54

python array

array = ["1st", "2nd", "3rd"];
#prints: ['1st', '2nd', '3rd']
Posted by: Guest on December-19-2019
21

python arrays

array = [1,2,3,4,5]
print(array,array[0],array[1],array[2],array[3],array[4]

#Output#
#[1,2,3,4,5] 1 2 3 4 5
Posted by: Guest on March-07-2020
11

python create array

variable = []
Posted by: Guest on April-10-2020
5

python array

#Setting The Array:#

array = [250,630,221] #You can have as many items as you want#

#Printing The Whole Array:#

print(array)
#output = [250, 630, 221,]#

#Printing Individual Items From The Array:#

print(array[0])
#output = 250#

print(array[1])
#output = 630#

print(array[2])
#output = 221#
#array[0] is the 1st array item, array[1] the 2nd, and so on#

#Printing Multiple Items From The Array:#

print(array[2],array[0])
#output = 221#
Posted by: Guest on August-09-2020
1

arrays python

array = [1, 2, 3, 4]

array.append(5)

for i in array:
  print(i)
Posted by: Guest on October-10-2020

Python Answers by Framework

Browse Popular Code Answers by Language