Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def greater_sum(first_list,second_list): #Declares a greater_sum function
- 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
- print(first_list)
- 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
- print(second_list)
- greater_sum([1,4,5],[1,7,3]) #Calls the greater sum function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement