This is the general reality with programming (and not just Python).
Floats are stored as binary, so there is inherently a rounding error converting back and forth between base 2 and 10. You need to format the number so it disregards those tiny rounding errors. If the tiny rounding errors are significant to your computations in your use case, you can do a bit more lifting with code to remove the issue (like multiplying times 100 so 0.05 becomes and integer for the sake of the increment and dividing by 100 for the sake of display).
import streamlit as st
import time
counter = st.empty()
total = 0
for i in range(20):
total += 0.05
counter.write(total)
time.sleep(0.2)
st.button('Do Over')