Skip to content

Instantly share code, notes, and snippets.

@RossignolVincent
Last active November 15, 2016 15:38
Show Gist options
  • Save RossignolVincent/921888bc44467182df95532debe138b5 to your computer and use it in GitHub Desktop.
Save RossignolVincent/921888bc44467182df95532debe138b5 to your computer and use it in GitHub Desktop.
Pair Product
def pairProduct (input) :
minProduct = 1
maxProduct = 1
tmp_list = list(input)
if not input :
print(0,0)
return
for i in range (0,2) :
if input :
minProduct *= min(input)
input.remove(min(input))
for j in range (0,2) :
if tmp_list :
maxProduct *= max(tmp_list)
tmp_list.remove(max(tmp_list))
print(minProduct, maxProduct)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment