“Min dan Max di Python” Kode Jawaban

Min Max Python

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

Min dan Max di 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
Gr@Y_orphan_ViLL@in##

Min Max Code di 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
VasteMonde

fungsi min () dan max () dalam python

>>> max(7,22,733,56)
733
>>> min(3,3663,8727,82)
3
>>> max('hello', 'how', 'are', 'you')
'you'
>>> min('hello', 'how', 'are', 'you', 'Sir')
'Sir'
Outrageous Ostrich

Jawaban yang mirip dengan “Min dan Max di Python”

Pertanyaan yang mirip dengan “Min dan Max di Python”

Lebih banyak jawaban terkait untuk “Min dan Max di Python” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya