¡GoConqr estrena diseño! Cuéntanos qué te parece.

Mapa mental

List Manipulation

Suja Nair Inglés

Contenido del mapa

List Manipulation

  1. Definition

    • Collection of items
      • Ordered
      • Mutable
      • Allows duplicates
  2. Creating Lists

    • Using square brackets
      • Example: my_list = [1, 2, 3]
    • Using the list() constructor
      • Example: my_list = list((1, 2, 3))
  3. Accessing List Elements

    • Using index
      • Starts at 0
      • Negative indexing for reverse
    • Slicing
      • Subsets of lists
      • Example: my_list[1:3]
  4. Nested Lists

    • Lists within lists
      • Multi-dimensional arrays
        • Example: l=[12,[34,56],78,90]
    • Accessing elements
      • my_list[0][1] for first sub-list
      • Iterating through nested lists
  5. List operations

    • Concatenation
      • Using the `+` operator
        • Example: `list1 + list2`
    • Replication
      • using the multiplication operator
        • syntax: list * n
    • Slicing
      • Extracting a portion of a list
        • Syntax: `list[start:end:step]`
  6. Built-in function

    • len()
      • Function to return the number of items
        • syntax: len(list_name)
    • list()
      • Creates a list in Python.
    • append()
      • Append an element to the end
        • Syntax: list.append(item)
    • extend()
      • Method to add multiple elements
        • Syntax: list.extend(iterable)
    • insert()
      • Insert an element at a specific index
        • Syntax: list.insert(index, element)
    • count()
      • Returns the number of occurrences
        • Syntax: list.count(element)
    • index()
      • Returns the index of an element
        • Syntax: list.index(element)
    • remove()
      • Removes the first occurrence of a value
        • Syntax: list.remove(value)
    • pop()
      • Removes the last item from a list Returns the item that was removed
      • Can remove an item at a specific index
      • Syntax: list.pop([index])
    • reverse()
      • Reverses the order of elements
        • Syntax: list.reverse()
    • sort()
      • Used for arranging elements
        • Modifies the original list
        • Syntax: list.sort()
    • sorted()
      • Sorts elements of a list
      • Returns a new sorted list
      • Syntax: sorted(iterable, key=None, reverse=False)
    • min()
      • Returns the smallest item
        • Syntax: min(list)
    • max()
      • Finds the largest item
        • Syntax: max(list)
    • sum()
      • Adds numerical values in a list
        • Syntax: sum(list)

Información

Descripción
Mapa Mental sobre List Manipulation, creado por Suja Nair el 17/05/2025.
Creado por
Suja Nair · may 2025
Actualizado
17 may 2025
Visitas
2
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?