Apr-20-2020, 04:09 AM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
sample_list = [ 8 , 2 , 3 , 0 , 7 ] print ( "Sample list: %s " % sample_list) def sum_list(lists): for x in lists: total = total + lists[x] return total print ( "Sum of all the number in the list: " ), print (sum_list(sample_list)) raw_input ( "\nPress ENTER to exit" ) |
It didn't work
Please help