I risked myself to see what’s wrong with your program. Turns out your python program is returning the same ip. it might be returning you the server’s ip.
If you mean on replit:
When running code like this, the code gets the server’s ip, in this case the virtual machine running your repl’s id. If you want to get a user’s ip, you need to open an output, for example Flask. Here is some flask code that allows you to get the users ip and use it for something:
from replit import db #To save ips
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
ip = request.headers['X-Forwarded-For']
db['ips'].append(ip)
app.run(host='0.0.0.0', port=81)