Array in Python

#----------------------------- 1 - creating, accessing, slicing an array -------------

# creating an array 

learn = ['Python','C','Java','C++','CSS','HTML','Flutter','Blender']

# Accessing a array

ret= learn[6]
print("Learn Animation using ",ret)

#  slicing an array

slice = learn[2:5]

print("Better helping Courses : ",slice)
#----------------------------- 2 - count,length, indexing an array -------------

learn = ['Python','C','Java','C++','CSS','HTML','Flutter','Blender']

# finding the lenght of the arrar
length = len(learn)
print("Lenght : ",length)

# counting the repetitionof an word in an array
counts = learn.count('Python')
print("Repeated for ",counts," times")

# finding the index value of an elemnt
ind = learn.index("C++")
print("C++ is @ index",ind,"in the Array")
#----------------------------- 3 - remove,clear, pop an array --------------------

learn = ['Python','C','Java','C++','CSS','HTML','Flutter','Blender']

# clearing all the elements in an array
clr =learn.clear()
print("Cleard the array",clr)

learn = ['Python','C','Java','C++','CSS','HTML','Flutter','Blender']

# pop is used to remove an element from the specified index
pops =learn.pop(4)
print("Popped element:",pops)  # prints the deleted element
print("The list is :",learn)

# remove is used to delete the specified element for the 1st occurance
learn = ['Python','Python','C','C','C','Java','C++','CSS','CSS','HTML','Flutter','Blender']
rem = learn.remove('C')  # deletes the 'C' for the 1st occurrance
rems= learn.remove('Python')  # deletes the 'Python' for the 1st occurrance
print("Removed elements")
print("The Array is:",learn)
#----------------------------- 4 - insert,append, extend,reverse an array ------------

learn = ['Python','C','Java','C++','CSS','HTML','Flutter','Blender']

# insert element @ specified index & moves the existing element to next index
ins =learn.insert(3, "C#")
print("Updated list :",learn)


# append adds the element to the end of the array
app = learn.append('Java Script')
print("Added elemet :",learn)

# extend is used to add a list of element in the array
list = ["MEAN","MERN","NodeJs"]
ext = learn.extend(list)
print("New list : ",learn)

# reverse is used to revese the given array
rev = learn.reverse()
print("Reversed list :",learn)

Join our team, where career growth knows no limits.

For More Details

Our internship program guarantees personalized attention for optimal career development in the tech industry.

+91 97879 68375

-> You should bring your own laptop during the internship

Who can apply?

Internships are open for students who: B.E / B.Tech / M.E / M.Tech / B.Sc / M.Sc / M.C.A / B.C.A / Diploma.

  • Ongoing Students Only
  • days, 5days/ 10days or Based on Student Preference
  • Limited 1 to 10 students per slot
  • Registration fees : 1000 INR
  • Slots are filling quickly only fewer slots are available