with open("studrec.dat", "rb+") as File: i[1] = input("Enter the new name") i[2] = int(input("Enter the new marks")) ...