I have books.txt and it contain 20 books with author,the books.txt look like so..
Mark Lutz/learning python
James payane/Beginning Python
Noah gift/Python for Unix and Linux System Administration
If user search for book it just print book and author if user search for author print (“you cannot search for author here ,you should look for title books here!.”)
def main(): search = input("which titel of book you are looking after? ") if search in open("books.txt").read(): parts = search.split("/") for part in parts: print(parts, " Books found.") main()
Edited 4 Years Ago by tony75