file_name = input("Enter the file name: ") #magicsquares.txt
#show users the table
infile = open(file_name, "r")
file = infile.readlines()
infile.close()
#converting the numbers in notepad into a list (integers)
table= []
for i in range (len(file)):
row= file[i].split(' ')
for j in range (len(row)):
row[j]= int(row[j])
table.append(row)
print (row)
#selecting cells
select1 = int(input("Enter row number: "))
select2= int(input("Enter column number: "))
This is a magic square with the list inside a notepad text file. How do I select the row and column in the list so that I can change the value of the specific coordinate in the list?
For example, the user inputs coordinate [0][1]. How do I locate that coordinate inside the notepad file and prompt the user to input an integer that replaces the original value at coordinate [0][1]?