About 17,300,000 results
Open links in new tab
  1. Python - Create List of Size n - GeeksforGeeks

    Dec 10, 2024 · Creating a list of size n in Python can be done in several ways. The easiest and most efficient way to create a list of size n is by multiplying a list. This method works well if we …

  2. Initialise a list to a specific length in Python - Stack Overflow

    How do I initialise a list with 10 times a default value in Python? I'm searching for a good-looking way to initialize a empty list with a specific range. So make a list that contains 10 zeros or …

  3. How To Initialize A List Of Size N In Python?

    Mar 3, 2025 · Learn how to initialize a list of size N in Python using list multiplication, list comprehension, and `range ()`. This guide includes step-by-step examples.

  4. Initialize a List of Any Size with Specific Values in Python

    Aug 20, 2023 · This article explains how to initialize a list of any size (number of elements) with specific values in Python. See the following article about initializing a NumPy array …

  5. How to initialize lists with specific length - LabEx

    Learn efficient Python list initialization techniques to create lists with specific lengths, covering methods, performance optimization, and best practices for developers.

  6. Top 2 Methods to Initialize a List with a Specific Length in Python

    Dec 5, 2024 · How can you efficiently initialize a list to a specific length in Python? Initializing a list with a predefined length, filled with a specific default value, can streamline your coding …

  7. Create a List of Size n in Python

    Learn how to create a list of a specified size in Python, initialized with a given value. This tutorial includes examples for creating integer, string, and None value lists.

  8. Initialising an array of fixed size in Python - Stack Overflow

    An easy solution is x = [None]*length, but note that it initializes all list elements to None. If the size is really fixed, you can do x=[None,None,None,None,None] as well.

  9. Python: Initialize List of Size N - Career Karma

    Aug 31, 2020 · To initialize a list of size n in Python, you can use multiplication syntax or a range () statement. On Career Karma, learn how to initialize empty lists of custom sizes.

  10. How to Initialize a List in Python - GeeksforGeeks

    Nov 25, 2024 · Python List is an ordered collections on items, where we can insert, modify and delete the values. Let's first see how to initialize the list in Python with help of different …

Refresh