[Tutor] list generation

Ed Connell edwinconnell at gmail.com
Mon May 10 14:59:08 EDT 2021


What is the best way to create a list of constant values of a given length?

gen_list( 78, 4 ) should generate [ 78, 78, 78, 78  ].

and

gen_list( 'pop', 2 ) should produce [ 'pop', 'pop' ]

Thanks,

Ed
-- 
I have a right and a left brain, but there is nothing right in the left one
and there is nothing left in the right one!


More information about the Tutor mailing list