Below, is what I tried.
st = "sss python's is fun's "
for ch in st:
if ch[-2:] in "'s": # check if last two index is 's
st = st.replace(ch, "")
somehow it will remove any s and ' not appear at the end.
How can I just remove the character that have " 's ".

New Topic/Question
Reply



MultiQuote





|