I'm trying to implement a basic converting program, changing stars to either <em> or </em> depending on if they are the first or second of a pair, but regardless of what I do my program changes all the stars to <em> or </em>.
line = "*ju*bil*ee*"
star_counter = 0
new_line = line
for character in line:
if character is "*":
star_counter += 1
if star_counter%2 == 0:
new_line = line.replace(character, "</em>")
else:
new_line = line.replace(character, "<em>")