STEM

Python teaser/puzzle 45588-1312

This is a quick Python coding puzzle or brain teaser for educational and/or entertainment purposes. The challenge is quite simple but is useful for learning or refreshing your coding skills while exercising some logical thinking.

Objective

Write a Python function that takes a list of integers as input and returns the 2 numbers that add up to the largest sum from that list. For example, given a list input: 1, 3, 4, 6, 8, 9 the function should return (8, 9) because of all the numbers, 8 + 9 = 17 is the largest sum possible from a pair of numbers in the list.

Click Run on the widget below to run the solution.

Try to solve it yourself first. If you’re stumped, click here for the solution.

Be sure to check out my Patreon page for downloads with more advanced apps, solutions, tips on Python, Excel, etc. here.

For more brain teasers and puzzles, click here.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top