
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
Python program to find the smallest number in a list
In this article, we will learn about the solution to the problem statement given below.
Problem statement − We are given al list, we need to display the smallest number available in the list
Here we can either sort the list and get the smallest element or use the built-in min() function to get the smallest element.
Now let’s observe the concept in the implementation below −
Example
list1 = [101, 120, 104, 145, 99] # sorting using built-in function list1.sort() print("Smallest element is:", list1[0])
Output
Smallest element is: 99
All the variables are declared in the local scope and their references are seen in the figure above.
Example
list1 = [101, 120, 104, 145, 99] #using built-in min fucntion print("Smallest element is:", min(list1))
Output
Smallest element is: 99
All the variables are declared in the local scope and their references are seen in the figure above.
Conclusion
In this article, we have learned about how we can find the smallest number in a list.
- Related Articles
- Python program to find Largest, Smallest, Second Largest, and Second Smallest in a List?
- Program to reduce list by given operation and find smallest remaining number in Python
- Python program to find the largest number in a list
- Program to find nth smallest number from a given matrix in Python
- Python program to find largest number in a list
- C# program to find Largest, Smallest, Second Largest, Second Smallest in a List
- 8085 Program to find the smallest number
- Python program to find the second largest number in a list
- C++ Program to find the smallest digit in a given number
- C++ program to find Second Smallest Element in a Linked List
- Java program to find the smallest number in an array
- Program to find the number of unique integers in a sorted list in Python
- Program to find the kth missing number from a list of elements in Python
- Python Program to Find the Second Largest Number in a List Using Bubble Sort
- Java program to find the 2nd smallest number in an array

Advertisements