About 150,000 results
Open links in new tab
  1. Loops in Python - GeeksforGeeks

    Mar 26, 2026 · Loops in Python are used to repeat actions efficiently. The main types are For loops (counting through items) and While loops (based on conditions). For Loop For loops is used to iterate …

  2. Python For Loops - W3Schools

    Python For Loops A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string). This is less like the for keyword in other programming languages, and …

  3. numpy.ndarray.shape — NumPy v2.4 Manual

    numpy.ndarray.shape # attribute ndarray.shape # Tuple of array dimensions. The shape property is usually used to get the current shape of an array, but may also be used to reshape the array in-place …

  4. Python for Loops: The Pythonic Way – Real Python

    Feb 23, 2026 · Learn how to use Python for loops to iterate over lists, tuples, strings, and dictionaries with Pythonic looping techniques.

  5. Loops - Learn Python - Free Interactive Python Tutorial

    Loops There are two types of loops in Python, for and while. The "for" loop For loops iterate over a given sequence. Here is an example: For loops can iterate over a sequence of numbers using the "range" …

  6. Python中的shape用法 - 知乎

    在 Python 中,`shape` 主要用于 ** NumPy 数组** 和 ** Pandas 的 DataFrame / Series ** 中,表示数据的维度信息。以下是详细用法和示例: 1. NumPy 中的 shape ---NumPy 是 Python 的科学计算库, …

  7. Nested For Loop in Python - Tutorial Kart

    Nested For Loop in Python In Python, a nested for loop is a loop inside another loop. The inner loop executes completely for each iteration of the outer loop, making it useful for working with multi …

  8. NumPy Array Shape - W3Schools

    Get the Shape of an Array NumPy arrays have an attribute called shape that returns a tuple with each index having the number of corresponding elements.

  9. Python While Loop - GeeksforGeeks

    Dec 23, 2025 · Let's take a look at Python While Loop in detail: Syntax while expression: statement (s) condition: This is a boolean expression. If it evaluates to True, the code inside the loop will execute. …

  10. Iterate over a list in Python - GeeksforGeeks

    Dec 27, 2025 · Python provides several ways to iterate over list. The simplest and the most common way to iterate over a list is to use a for loop. This method allows us to access each element in the list …