Computer Science, asked by sakshi1872004, 3 months ago

write a program that prints minimum and maximum of five nos. entered by the users in python program????​

Answers

Answered by allysia
3

Answer:

The python code goes like:

________________________

l=[]

for i in range(5):

   n=int(input("Enter a number: "))

   l.append(n)

print(min(l))

_______________________

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!

Similar questions