Hint
Start by setting up a simple Streamlit app with a title and a button:
import streamlit as st
st.title("Find My IP")
if st.button("Get My IP"):
# Add logic here
Now think: how can you find out the user's public IP?
Try using the requests
library with this simple API:
import requests
response = requests.get("https://api.ipify.org?format=json")
data = response.json()
Once you have the IP, display it on the page using:
st.success(f"Your IP is: {data['ip']}")