min max code in python

Solutions on MaxInterview for min max code in python by the best coders in the world

showing results for - "min max code in python"
Matilda
26 Jan 2020
1listA = [18, 19, 21, 22]
2print('The smallest number from listA is:', min(listA))  	# 18
3print('The largest number from listA is:', max(listA))		# 22
4
5strA = 'AppDividend'
6print('The smallest character from strA is:', min(strA))	# A
7print('The largest character from strA is:', max(strA))		# v
8
9strA = 'AppDividend'
10strB = 'Facebook'
11strC = 'Amazon'
12print('The smallest string is:', min(strA, strB, strC))		# Amazon
13print('The largest string is:', max(strA, strB, strC))		# Facebook