Jun-24-2020, 02:29 AM
(This post was last modified: Jun-24-2020, 02:30 AM by pyzyx3qwerty.)
If list1's length is greater, you could store numbers under a variable like
nums = list1[0:]If it's smaller, define the variable as
nums = list1[0:n]Then, in the end, call the sum of
nums
likereturn sum(nums)It will give expected output
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs