Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
print("Build the array...")
myArray = []
print("enter e when you have entered all expected elements in the array.")

while True:
	elem = input("enter the integer you want to add : ")
	if elem == "e":
		break
	else:
		myArray.append(int(elem))

print("your array is : "+ str(myArray))

#now inserting element in the array 
elem  = input(" enter the element you want to insert in the array : ")
i = int(input("enter the index you want to enter it : "))

myArray.insert(i,elem)

print("Newly formed array : "+str(myArray))