Skip to content

Codes #581

@Sumeetgaikwad27

Description

@Sumeetgaikwad27

list=[5,4,1,2,6,3,7]
list.append(0) #append specified element at end of the list
print(list)
print(type(list)) #print type of list
print(len(list)) #print length of the list
print(list[2])
list.sort() #sort list in ascending order
print(list)
#list.sort(reverse=True) #sort list in descending order
print(list)
list.insert(4,5) #insert element at specified index with specified value
print(list)
list[0]="Sumeet" #update element at specified index
print(list)
list.reverse() #reverse the list
print(list)
print(list[2:5]) #slicing the list at specified start and end index
list.remove(5) #removes first occurrence of element
print(list)
list.pop(1) #removes element at specified index
print(list)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions