fb pixel

Introduction to Python

  • Profound Academy

    • Status
      • 1
        Input and Output
      • 2
        Variables and Integer Arithmetic
      • 3
        Conditional Operators
      • 4
        Advanced Conditions - Nesting
      • 5
        Types and Variables
      • 6
        Strings
      • 7
        Lists
      • 8
        For Loops
      • 9
        While Loops
      • 10
        continue, break, while...else
      • 11
        String and List methods
      • 12
        Nested Loops
      • 13
        List Comprehension
      • 14
        Tuples and Sets
      • 15
        dict
      • 16
        Functions
      • 17
        Functions 2
      • 18
        Lambda and higher-order functions
      • 19
        Files

  • Searching the docs

    When searching through the class documents you want to find the title of the class that you would like to rehearse before the exam. You remember some words from the title but you’re not sure about the rest. To automate that process you decide to write a program that would do the search for you.
    You will first input the number of documents covered in the class n. The next n lines will be the titles of those documents. Then, you’ll input the number of words you remember w. The next w lines will contain the w words you remember from that title.
    The program should output all the document titles that have all of the words you remember.
    Note that you would like to do a case-insensitive search, so you’d want the search engine to ignore the uppercase-lowercase differences.
    Input
    Output
    4 Google and the page-rank algorithm to search the web content Neural Networks and document ranking to re-rank the web pages BERT models and the web - do they actually work for big content docs Page-rank and how to handle leaf nodes 2 web content
    Google and the page-rank algorithm to search the web content BERT models and the web - do they actually work for big content docs
     
    To check your solution you need to sign in
    Sign in to continue