Example:
Input: i j k
Enter a value for n = 4
Output: I1 I2 I3 I4 J1 J2 J3 J4 K1 K2 K3 K4
I can't seem to separate the word and the number. I am getting
I 1 I 2 I 3 I 4 J 1 J 2 J 3 J 4 K 1 K 2 K 3 K 4
instead of
I1 I2 I3 I4 J1 J2 J3 J4 K1 K2 K3 K4
my_list = input("Input: ")
up_list = my_list.upper()
var =''
new_list2 = ""
lists = up_list.split()
n = int(input("Enter a value for n: "))
for x in lists:
for y in range(1, n+1):
w = str(y)
new_list = ('{}{}'.format(x, y))
new_list2 += new_list
for i in new_list2:
var += i
var += " "
print(var)