I am noob, so please excuse me.
There are three lists.
- List of letters L = ['A', 'B', 'C', 'D', 'E']
- List of numbers N = ['1', '2', '3', '4', '5']
- List of string numbers List = ['124', '351']
These are the steps that I want to achieve.
- Request a letter from the user, for example. A
- Find the letter in the list of letters L and write down its numerical position, for example. [0]
- Use the same digital position in the list of numbers N and write down the number, which, for example, 1
- Replace instances of the number found in non-letter strings List , for example. ['124', '351'] becomes ['A24', '35A']
- Ask the user about the next letter until all the number lines are letters.
What I have achieved so far is the first 4 steps. After step 4, I decided to check if the lines of numbers contain numbers, and if so, go to step 5. I canβt figure out how to get the code to check if the number of lines contains more than a number. NOTE. The list of numbers is not limited to numbers. It may contain mathematical symbols, for example. + or -
L = ['A','B','C','D','E'] N = ['1','2','3','4','5'] list = ['124','351'] print ("Enter a letter")
I hope everything is in order. If you need anything, please let me know.
source share