write a program that prints minimum and maximum of five nos. entered by the users in python program????
Answers
Answered by
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
6
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