362,207 views
33 votes
33 votes
Python and using function

Takes two integer parameters. Returns the integer that is closest to 10

User Tienph
by
2.7k points

1 Answer

15 votes
15 votes

Answer:

def closest_to_10(num1, num2):

if num1-10 < num2-10:

return num2

else:

return num1

Step-by-step explanation:

User SteveMc
by
2.8k points