<human>:  How to count the number of a specific character at the end of a string ignoring duplicates?
<bot>: Here is some code to count the number of trailing question marks in string `my_text`

len(my_text) - len(my_text.rstrip('?'))

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.