I have a .txt
file where names and addresses appear in the following format:
Sam, 35 Marly Road
...
...
I want to be able to search Sam
and for 35 Marly Road
to come up.
Here is the code I have so far:
name = input("Please insert your required Client's name: ")
if name in open('clientAddress.txt').read():
print ("Client Found")`
This checks if the ID inputted is available in the file, but it doesn't print the address. How do I change it, so it finds the name and prints the address?