Computer Science, asked by mmusicnirwana, 4 months ago

write a program that prints the minimum and the maximum of five numbers entered by the user​

Answers

Answered by jai696
6

\large\mathsf\color{pink}{Solution\: using\: python\: 3}

def _min(nums):

_min = nums[0]

for n in nums:

if _min > n:

_min = n

return _min

def _max(nums):

_max = nums[0]

for n in nums:

if _max < n:

_max = n

return _max

nums = [int(n) for n in input("enter 5 nums: ").split()]

print(f"min: {_min(nums)}\nmax: {_max(nums)}")

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by Japji21
2

Answer:

Solutionusingpython3

def _min(nums):

_min = nums[0]

for n in nums:

if _min > n:

_min = n

return _min

def _max(nums):

_max = nums[0]

for n in nums:

if _max < n:

_max = n

return _max

nums = [int(n) for n in input("enter 5 nums: ").split()]

print(f"min: {_min(nums)}\nmax: {_max(nums)}")

Similar questions