Answers for "array manipulation python"

2

array in python

#in python we consider lists to be arrays 
MyArray = ["Kathmandu", "Bardaghat", "Butwal", "Biratnagar"]
#array of places of Nepal
#we can print it by 
print(MyArray)
Posted by: Guest on October-06-2021
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
-1

array in python

# Python program to demonstrate
# Creation of Array
 
# importing "array" for array creations
import array as arr
 
# creating an array with integer type
a = arr.array('i', [1, 2, 3])
 
# printing original array
print ("The new created array is : ", end =" ")
for i in range (0, 3):
    print (a[i], end =" ")
print()
 
# creating an array with float type
b = arr.array('d', [2.5, 3.2, 3.3])
 
# printing original array
print ("The new created array is : ", end =" ")
for i in range (0, 3):
    print (b[i], end =" ")
Posted by: Guest on January-15-2022

Code answers related to "array manipulation python"

Python Answers by Framework

Browse Popular Code Answers by Language