mary has $500 in her savings account and she buy a pair of shoes every week for $125 write a function

y=125x

To write a function that calculates how many pairs of shoes Mary can buy with her savings, we can use the following steps:

1. Define the function and give it a meaningful name, such as `calculateShoes`.
2. Declare the function parameters. In this case, we only need one parameter: the amount of money Mary has in her savings account. Let's call this parameter `savings`.
3. Inside the function, initialize a variable to keep track of the number of shoes Mary can buy. Let's call this variable `shoesCount` and set it to 0.
4. Use a loop to continuously subtract $125 (the price of a pair of shoes) from `savings` until the remaining amount is less than $125.
5. Increment `shoesCount` by 1 for each loop iteration.
6. Finally, return `shoesCount` as the output of the function.

Here is the function written in Python:

```python
def calculateShoes(savings):
shoesCount = 0
while savings >= 125:
savings -= 125
shoesCount += 1
return shoesCount
```

Now, you can call this function and pass Mary's savings as an argument to get the result. For example:

```python
marySavings = 500
shoesPurchased = calculateShoes(marySavings)
print("Mary can buy", shoesPurchased, "pairs of shoes.")
```

This will output: "Mary can buy 4 pairs of shoes."