111k views
4 votes
Write a function definition for function named equals which takes 3 integers and returns true if sum of the first two arguments is greater than the third argument, and returns false otherwise. For example, equals(2,4,5) should return true because 2+4>5.

User Drk
by
8.8k points

1 Answer

4 votes

Final answer:

A function named 'equals' in Python checks if the sum of the first two integer arguments is greater than the third. It returns true if it is, false otherwise.

Step-by-step explanation:

The student has asked to write a function definition named equals which checks if the sum of two integers is greater than a third integer. Below is a simple function in Python that accomplishes this task:

def equals(a, b, c):
return (a + b) > c
When you call equals(2, 4, 5), it will return true because the sum of the first two arguments (2 + 4) is greater than the third argument (5).
User Weldon
by
8.2k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.