What I would like to do is that when the user types the name of a person who was inside the .csv file, his line and the lines of movies that he evaluated were deleted (I used an identifier for that), the code is this:
import csv
with open("arquivo.csv", "r") as arq:
linhas = csv.reader(arq, delimiter=";")
critico = input("Digite o nome do crítico que você deseja deletar..: ").capitalize()
for linha in linhas:
tipo, identificador, nome, nota = linha
if tipo == "C":
if critico in linha:
ident = linha[1]
print(linha)
if tipo == "F" and identificador == ident:
print(linha)
and I'm using this data saved in .csv to read:
C;1;Kenneth;[email protected]
F;1;Matrix;5.0
F;1;Mad Max;4.5
C;2;Josue;[email protected]
F;2;Miss Sunshine;4.2
C;3;Maria;[email protected]
F;3;Amelie Poulain;3.0
F;3;Drive;2.0
What do I do to delete the lines of a critic?