Write a function called `adding_squares`

that takes two inputs, `x`

and `y`

and returns the sum of the squares of each of those numbers. For example, if `adding_squares(2, 3)`

is called, it should return the sum of `4`

and `9`

, which is `13`

.

Try this:

```
def adding_squares(x, y):
x = x ** 2
y = y ** 2
return x + y
print(adding_squares(2, 3)) # prints 13
```

1 Like

Oh thanks, yes of course. I am not thinkingâ€¦

1 Like

Lol I am sorry for giving the solution . These stupid situations happen to me sometimes when I donâ€™t think well .

1 Like

I am surely will ask for another help againâ€¦ if my brain is not working.

1 Like

Think this out however. You wonâ€™t learn anything by blindly accepting a solution.

So okay, I need to create a function with 2 parameters:

```
def adding_squares(x,y):
```

How do we get the square of a number? By multiplying it by itself.

Then they want us to add the sum of those squares.

Break the instructions down so you can understand the task.

If you understand what they are asking you to do, you will be able to find (if possible) more efficient solutions.

3 Likes

```
def adding_squares(x,y):
return x ** 2 + y ** 2
```

This is my take.

Thanksâ€¦ im better with more thinking now before giving up.