Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

min and max in python

#min and max in python
L1 = eval(input('enter list:'))#eval() helps  inputting by user desires of list.
minimum=min(L1)#min() function helps to note smallest of the element.
print('minimum numeric',minimum)
maximum=max(L1)#max() function helps to note biggest of the element.
print('maximum numeric',maximum)
#output
enter list:[4,-8,65,24.0,24,7.25]
minimum numeric -8
maximum numeric 65
Comment

min max python

def min_max(*n):
  return {"min":min(n),"max":max(n)}
print(min_max(-10,1,2,3,45))
Comment

min max code in python

listA = [18, 19, 21, 22]
print('The smallest number from listA is:', min(listA))  	# 18
print('The largest number from listA is:', max(listA))		# 22

strA = 'AppDividend'
print('The smallest character from strA is:', min(strA))	# A
print('The largest character from strA is:', max(strA))		# v

strA = 'AppDividend'
strB = 'Facebook'
strC = 'Amazon'
print('The smallest string is:', min(strA, strB, strC))		# Amazon
print('The largest string is:', max(strA, strB, strC))		# Facebook
Comment

PREVIOUS NEXT
Code Example
Python :: python add 1 
Python :: find last element in list python 
Python :: tkinter while button not pressed 
Python :: how to make a calculator 
Python :: how to add one to the index of a list 
Python :: jquery datepicker disable 
Python :: parce que in english 
Python :: python3 delete file 
Python :: odd number sum in python 
Python :: csv to txt code pandas 
Python :: get category discord.py 
Python :: opencv rgb to gray custom 
Python :: python port forwarding 
Python :: part of a flower 
Python :: how to swap numbers in python mathematically 
Python :: python 3.4 release date 
Python :: pandas qcut 
Python :: and logic python 
Python :: make guessing game by python 
Python :: python numpy euler 
Python :: python program to find sqaure root of the number 
Python :: pandas merge_asof direction 
Python :: loading .dat file in python 
Python :: medium seaaborn mathplot diesign styles 
Python :: Installez django-cruds-adminlte 
Python :: pip upgrade command 
Shell :: stop nginx ubuntu 
Shell :: expo fix dependencies 
Shell :: apache2.service is not active cannot reload. ubuntu 
Shell :: chrome update ubuntu 20.04 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =