Question: In Python 3 Complete the function sum_to(n) to sum the integers starting at one until the sum equals or exceeds the target n. For example,
In Python 3

Complete the function sum_to(n) to sum the integers starting at one until the sum equals or exceeds the target n. For example, if target is 10 the sum of the integers 1, 2, 3, 4 equals 10. Return the maximum integer, the last, that was added to the sum to reach the target. In the example this would be the four (4). If the target is 100 the result would be 14, the sum of 1.. 14 is 105. Save & Run Original - 1 of 1 Show Feedback Hide Code Show CodeLens 1 def sum_to (n): 2 # your code here 3 Activity: 1 ActiveCode (sum_to_max_pdc)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
