Q. Consider the file "contacts.csv" created in above Q. and figure out what the following code is trying to do?



name = input("Enter name :")

file = open("contacts.csv", "r")

for line in file:

    if name in line:

        print (line)



Answer = 

Name (Data) input from user and give the output if name (data) present in "contacts.csv" file then give full details of that name(data), Otherwise it do nothing.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post