s = (
    'deviceId={servicename.DeviceID}&deviceGroupID={servicename.GroupID}&abcd=dkef'
    )
r = ['ApplC3LDJXGEDCP7', '10']
How to iterate a list over re.sub and replace variables in a string using python?