Answers for "stack overflow python array"

0

stack overflow python array

# empty array
arr = [] 

# init with values (can contain mixed types)
arr = [1, "eels"]

# get item by index (can be negative to access end of array)
arr = [1, 2, 3, 4, 5, 6]
arr[0]  # 1
arr[-1] # 6

# get length
length = len(arr)

# supports append and insert
arr.append(8)
arr.insert(6, 7)
Posted by: Guest on May-01-2021
0

how create array in python stack overflow

myarray = []
Posted by: Guest on July-07-2020

Python Answers by Framework

Browse Popular Code Answers by Language