I am attempting to create code where the user can alter the A elements in the list continuously. If another letter in the list is replaced however, it should ask for new input from the user, and go back to the code where the user can alter A elements in the list. My code isn't working however. I am new to coding, so please don't explain things in a complicated manner. I need help!
Here is my code:
list = [['A', 'B', 'A'],['C', 'D', 'B']] print m f=input("Index for sublist ") g=input("Index for sublist item ") def errordetection (): print "Please select another sublist item to replace" f=input("Index for sublist ") g=input("Index for sublist item ") while (m[f][g]!='A'): errordetection() if (m[f][g]=='A'): m[f][g]='C' print list
Edited 6 Years Ago by James0l9l: n/a