def create_youtube_string(module):
 youtube_ids = [module.youtube_id_0_75, module.youtube_id_1_0, module.youtube_id_1_25, module.youtube_id_1_5]
 youtube_speeds = ['0.75', '1.00', '1.25', '1.50']
 return ','.join([':'.join(pair) for pair in zip(youtube_speeds, youtube_ids) if pair[1]])

def create_youtube_string ( module ) : youtube_ids = [ module . youtube_id_0_75 , module . youtube_id_1_0 , module . youtube_id_1_25 , module . youtube_id_1_5 ] youtube_speeds = [ '0.75' , '1.00' , '1.25' , '1.50' ] return ',' . join ( [ ':' . join ( pair ) for pair in zip ( youtube_speeds , youtube_ids ) if pair [ 1 ] ] )
create a string of youtube ids from modules metadata attributes .