How does this script work, when I can 1 function but 3 functions work at the same time? : <p>This code is copied from <a href="https://www.youtube.com/watch?v=XhXOsgdC9h0" rel="nofollow noreferrer">https://www.youtube.com/watch?v=XhXOsgdC9h0</a></p>

<pre><code>import requests
from bs4 import BeautifulSoup
import operator

#get all the words in the website
def all_words(url,):
    word_list = []
    source_code = requests.get(url).text #connect to url
    soup = BeautifulSoup(source_code, "html.parser")
    for before_text in soup.find_all("a", {"class": "result-title"}):
        content = before_text.string
        words = content.lower().split() #trun all words into lower case and split
        for each_word in words:
            word_list.append(each_word)
    clean_up_list(word_list)

#remove all the symbols in each word
def clean_up_list(word_list):
    clean_word_list = []
    for word in word_list:
        symbols = "!@#$%^&amp;*()_+[]\"\-;',./&lt;&gt;?"
        for  i in range(0, len(symbols)):
            word = word.replace(symbols[i], "") #replace all symbols with blank space
        if len(word) &gt; 0: #only word with length &gt; 0 can be added
            print(word)
            clean_word_list.append(word)
    create_dictionary(clean_word_list)

#count the frequency of each word in the list
def create_dictionary(clean_word_list):
    word_count = {}
    for word in clean_word_list:
        if word in word_count:
            word_count[word] += 1
        else:
            word_count[word] = 1
    for key, value in sorted(word_count.items(), key = operator.itemgetter(1)): #sort the item from the largest value
        print (key, value)

all_words("https://cnj.craigslist.org/search/sys")
</code></pre>

<p>So the code just tries to count the frequency of each word in a website. I don't understand that I only call the function <code>all_words</code>, but it actually runs all the functions inside the code. How does it happen?</p>

<p>Thank you!</p>
