Python

Python Menu

Python

Python min() Function - Definition, Syntax, Parameters, Examples

Definition

The min() function returns the item with the lowest value, or the item with the lowest value in an iterable.

If the values are strings, an alphabetical comparison is done.

Syntax

min(iterable)

Parameters

Parameter Description
iterable An iterable, with one or more items to compare

Examples

myNum = (1, 5, 3, 6) print(min(myNum)) #for strings myStrings = ("Hello","World","Goodbye") x= min(myStrings) print(x)

Introduction

Python Basics

Python Advance

Data Science Python Tutorials

Python Functions and Methods