Advertisement
OsahonE

Wk5_4

Apr 1st, 2020
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. def greater_sum(list1, list2):
  2.    
  3.     #the conditions below allows for the greater list to be outputed.
  4.    
  5.     if sum(list1) > sum(list2):
  6.         return list1
  7.     else:
  8.         return list2
  9.        
  10. print(greater_sum([1, 3, 5, 7, 9], [2, 4, 6, 8, 10]))
  11. print(greater_sum([2, 6, 10, 14, 18], [2, 4, 6, 8, 10]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement