You can download this code by clicking the button below.
This code is now available for download.
This function takes a list of numbers as input and returns the sum of all numbers in the list that are divisible by 3.
Technology Stack : List comprehension, sum function, 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)