def find_format_specifiers(s):
    'Find all format specifiers in a string.'
    pos = 0
    specifiers = []
    while True:
        percent = s.find('%', pos)
        if (percent < 0):
            break
        try:
            specifiers.append(s[(percent + 1)])
        except:
            print('Failed to get specifier')
        pos = (percent + 2)
    return specifiers
Find all format specifiers in a string.
def find_format_specifiers(s):
    
    pos = 0
    specifiers = []
    while True:
        percent = s.find('%', pos)
        if (percent < 0):
            break
        try:
            specifiers.append(s[(percent + 1)])
        except:
            print('Failed to get specifier')
        pos = (percent + 2)
    return specifiers