Advertisement
dprincef

Untitled

Feb 28th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. def greater_sum(first_list,second_list): #Declares a greater_sum function
  2.     if sum(first_list) > sum(second_list): #Checks if the sum of the first_list is greater than the sum of the second list and prints the first list if true
  3.         print(first_list)
  4.     elif sum(second_list) > sum(first_list): #Checks if the sum of the second_list is greater than the sum of the first_list and prints the second_list if true
  5.         print(second_list)
  6. greater_sum([1,4,5],[1,7,3]) #Calls the greater sum function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement