forked from Ash515/PyScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMax_Min.py
More file actions
26 lines (26 loc) Β· 749 Bytes
/
Copy pathMax_Min.py
File metadata and controls
26 lines (26 loc) Β· 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
print("To print the maximum and Minimum values in the list")
def Max(array):
print("*****Maximum Values******")
if(array):
array.sort()
print("Your sorted list",array)
Max=max(array)
return Max
else:
return 0
def Min(array):
print("*****Minimum Values******")
if(array):
array.sort()
print("Your sorted list",array)
Min=min(array)
return Min
else:
return 0
ary=[]
total=int(input("Enter the total values into list:"))
for i in range(total):
values=int(input("Enter the list of values:"))
ary.append(values)
print("The Maximum value in your list is",Max(ary))
print("The Minimum value in your list is",Min(ary))