Q:

. Write a Python program to create a list by concatenating a given list which range goes from 1 to n.

0

. Write a Python program to create a list by concatenating a given list which range goes from 1 to n. 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

my_list = ['p', 'q']
n = 4
new_list = ['{}{}'.format(x, y) for y in range(1, n+1) for x in my_list]
print(new_list)

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now