Skip to content

over_nine_thousand() takes a list of numbers named lst as a parameter. It sums the elements of the list until the sum is greater than 9000. When this happens, the function should return the sum. If the sum of all of the elements is never greater than 9000, the function should return total sum of all the elements. If the list is empty, the functi…

Notifications You must be signed in to change notification settings

candytale55/over_nine_thousand_Py_3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

over_nine_thousand_Py_3

over_nine_thousand() takes a list of numbers named lst as a parameter.

It sums the elements of the list until the sum is greater than 9000. When this happens, the function should return the sum.

If the sum of all of the elements is never greater than 9000, the function should return total sum of all the elements.

If the list is empty, the function should return 0.

For example, if lst was [8000, 900, 120, 5000], then the function should return 9020.

Technologies

  • Python 3

Setup

NA - It's only coding examples, there's no setup.

Status

Project is: finished, - may come back and improve it, or not.

References

Based on Codecademy's Learn Python 3 course, Code Challenges exercises

About

over_nine_thousand() takes a list of numbers named lst as a parameter. It sums the elements of the list until the sum is greater than 9000. When this happens, the function should return the sum. If the sum of all of the elements is never greater than 9000, the function should return total sum of all the elements. If the list is empty, the functi…

Topics

Resources

Stars

Watchers

Forks

Languages