#!/usr/bin/env python # -*- coding:utf-8 -*- lst = [1,2,3,4,5] str = '-'.join(str(n) for n in lst) print(str)