Sum of integers greater than or equal to 10

This technical problem involves writing a function that takes a list of integers as input and returns the sum of all integers that are greater than or equal to 10. An example input and output is provided .

Problem

Given a list of integers, write a function that returns the sum of the integers that are greater than or equal to 10.
Example input: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
Example output: 75

Solution

This solution is in Python. Our A.I. can create solutions in multiple languages.
by kayakane
def sum_of_integers(list_of_integers):
    sum = 0
    for i in list_of_integers:
        if i >= 10:
            sum += i
    return sum

print(sum_of_integers([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]))

A.I. Evaluation of the Solution

The candidate's solution correctly solves the problem. They iterate through the list, checking if each integer is greater than or equal to 10. If it is, they add it to the sum. This is a solid approach and the code is clean and easy to read.

Evaluated at: 2022-11-20 14:16:14