Table of Contents

Max Min Product List

In Python Create a List and find out the following action:

  • Press 1 to Find the Larger Value in Python List.
  • Press 2 to Find the Smallest Value in Python List.
  • Press 3 to Find the Product Value in Python List.
Example of Max Min Product List
x = [100, 2, 300, 10, 11, 1000]
while True:
 print("Press 1 for Large Value")
 print("Press 2 for Small Value")
 print("Press 3 for product Value")
 print("Press 4 for Exit")
 a=input()
 if a=='1':
 i = x[0]
 for n in x:
  if n > i:
   i = n
  print(i)
elif a=='2':
i = x[0]
for n in x:
if n < i:
i = n
print(i)
elif a=='3':
i = x[0]
a=1
for n in x:
a=a*n
print(a)
elif a=='4':
break
else:
print("Wrong Input, After five wrong Input Program Will be closed",tt+1)
print("Thank You")