Beginner, Tic Tac Toe

Im trying to learn python and i decided to try and make a text based tic tac toe game.
I dont have the matching up yet (where the rows say there are 3 in a row they win). But I have this so far and as you can use my terrible re-use of code and that bad loopme thing.

I was wondering if anyone could give me a little code refactoring (without making it too confusing), then I can understand how I can realistically use these functions.