You can download this code by clicking the button below.
This code is now available for download.
Calculate the sum of all numbers in a list that are divisible by three.
Technology Stack : List comprehension, sum operator, modulo operator
Code Type : Function
Code Difficulty : Intermediate
def sum_divisible_by_three(numbers):
return sum(num for num in numbers if num % 3 == 0)