I have below inputs,
inp = 'Sample'
n = 5
I would like to generate a list of tuples of n
elements packing input
with index. So that my output is,
[('Sample', 0), ('Sample', 1), ('Sample', 2), ('Sample', 3), ('Sample', 4)]
Below snippet does the work neat,
output = zip([inp]*n, range(n))
Just curious about alternate approaches to solve the same?