92.9k views
3 votes
Write code to add two numbers, 5 and 7. Then display the sum on the serial monitor.

User JacobW
by
3.6k points

1 Answer

3 votes

Answer:

Step-by-step explanation

Using the Python 3 syntax in writing the code.

First we will define a function 'add_numbers', parse in the variables x and y and return its sum as shown.

Then we carry out the addition of 5 and 7.

def sum_numbers(x, y):

return x+y

sum_numbers(5, 7)

User Jim Johnson
by
3.3k points