Let's say I have these two lists:
alpha = ['A', 'B', 'C']
nums = ['1', '2', '3']
What I want to do is to assign each element in alpha to each element in nums. Using a for loop, I would do something like:
for i in alpha:
for n in nums:
print(f"{i}{n}")
Output:
A1, A2, A3, B1, B2, B3, C1, C2, C3
But what I want is only to assign A to 1, B to 2, and C to 3, without actually creating a list. I want to do this so that when I ask for input, if the user enters A, I can change 1 to a desired number later in the nums list. Let me clarify this by showing the desired result:
Enter letter: A
The new list is [4, 2, 3]
Also, I don't want to make an if loop because in actuality, I am working with a large list. How to implement such a thing?