About 2,930,000 results
Open links in new tab
  1. Smallest number in an array python - Stack Overflow

    Apr 10, 2014 · Trying to find the smallest number in an array that the user inputs. Here's what I have: def main(): numbers = eval(input("Give me an array of numbers: ")) smallest = …

  2. Python program to find smallest number in a list

    Oct 23, 2024 · The simplest way to find the smallest number in a list is by using Python's built-in min () function. The min () function takes an iterable (like a list, typle etc.) and returns the …

  3. How to Find the Largest and Smallest Numbers in Python? - Python

    Aug 29, 2024 · To find the largest and smallest number in a list in Python, you can use the built-in functions max() and min(). For example, if you have a list numbers = [3, 1, 4, 1, 5, 9, 2], you …

  4. How to get largest and smallest number in an Array?

    Sep 13, 2022 · Follow the steps to solve the problem: Create a variable mini/maxi and initialize it with the value at index zero of the array. Iterate over the array and compare if the current …

  5. Find Smallest element in an array using Python | Prepinsta

    To find the minimum element in the given list or array we can use different approaches to get the minimum element. Here, in this page we will discuss the following algorithms to find the …

  6. Python Program to Find Smallest Number in an Array

    Write a Python Program to Find the Smallest Number in an Array, and the numpy min function returns the Smallest or minimum value in an array.

  7. Find the smallest and second smallest elements in an array

    Mar 11, 2025 · Given an array arr[] of size N, find the smallest and second smallest element in an array. Examples: Input: arr[] = {12, 13, 1, 10, 34, 1} Output: 1 10 Explanation: The smallest …

  8. Python Program to Find the Smallest Element in a NumPy Array

    May 15, 2025 · The simplest way to find the smallest element in a NumPy array is by using the built-in min() function in Python. This method works on arrays of any dimension. Output: You …

  9. 3 Easy Methods to Find the Smallest Number in Python

    Jul 3, 2021 · How to Find the Smallest Number in Python? We aim to find the smallest number in Python of all the numbers given in a list. Say if the list is: [32, 54, 67, 21] The output should be: …

  10. Smallest Number in an Array Python | by Penumudi Varun

    By sorting the array (using in-built functions/methods) the smallest number will come to the first position (i.e. index 0) of the array. But what if you want to write this program without using...

  11. Some results have been removed