Heads Up :
The post you are writing will appear in a public forum. Please ensure all content is appropriate for public consumption. Review the employee guidelines for the community here.
I would recommend you to use this codedevices['ip'] =device_info_list[2].split('/')[0]except devices['ip'] = device_info_list[2].strip('/32') It is more universal and will work correctly with IPs, ending by digit 3 and 2 with which you have a problem...