To those here asking about learning basic python. I am sharing my blog post which demonstrates a basic function.
https://personaljournal.ca/paulsutton/code-club-simple-python-3-functions
I don't think I need to pass the value of y to the function, nevertheless the program still works. If you keep y in place you can add a count to monitor what the loop is doing.