my_text = 'one? two three??'
total = 0
question_mark = '?'
i = 0
for c in my_text:
    i -= 1
if my_text[i] == question_mark:
    total += 1
else:
    break
How to count the number of a specific character at the end of a string ignoring duplicates?