Hangman Game Efficiency
Welcome to CodeReview! Your general structure is already pretty good and the comments made the code easy to read. Here are some key suggestions and explanations. The full code can be found at the bottom.

Comments
Comments should generally not (have to) explain every single line, especially really simple lines like an import:
# This imports the random function
import random

Any Python developer that reads this will know what the line does. Adding a comment here significantly increases the time needed to read and understand the code, so I'd advise against simple comments like this.

f-Strings
f-Strings offer a convenient and readable way to print text that includes variables:
print(&quot;You have &quot; + tries + &quot; tries left.&quot;)

becomes
print(f&quot;You have {tries} tries left.&quot;)


dashes and update_dashes
Since you need to modify dashes multiple times I would suggest a mutable data type instead of a str, e.g. a list.
dashes = [&quot;-&quot;] * len(secret_word)

Since it's now a list, we would need to print it by calling &quot;&quot;.join(dashes). We'll put that in its own seperate __str__ function in the next point.
This allows for a more concise definition of update_dashes(...):
def update_dashes(secret_word, dashes, user_guess):
    for index, letter in enumerate(secret_word):
        if letter == user_guess:
            dashes[index] = user_guess

Multiple things to notice here:

dashes is modified in-place, therefore we don't need to return it. Passing it to the function is enough.
Using enumerate will give us index and letter for all letters in secret_word. This approach is more pythonic than iterating over a range and accessing the elements by their index.
We do not immediately return once we find a matching letter. This is important because we can have multiple occurences of the same letter in secret_word.


class Dashes
I would say dashes combines enough unique logic, for it to make sense to make it a standalone-class. This comes down to some personal preference, but I find it improves the code structure here.
class Dashes:
    PLACEHOLDER = &quot;-&quot;

    def __init__(self, secret_word):
        self.secret_word = secret_word
        self.letters = [self.PLACEHOLDER] * len(secret_word)

    def update(self, guess):
        for index, letter in enumerate(self.secret_word):
            if letter == guess:
                self.letters[index] = guess

    def is_completed(self):
        return self.PLACEHOLDER not in self.letters

    def __str__(self):
        return &quot;&quot;.join(self.letters)

As you can see, Dashes now handles a lot of useful logic for the rest of our program.

Complete code
Some other points worth mentioning:

You should avoid using global variables as far as possible. Global variables aren't good practice, as they can lead to some unexpected behaviour / confusing bugs.
Wrapping your program's main functionality into a main() function is generally good practice. Wrapping your call to main() into a if __name__ == '__main__': condition is also a good idea. You can read more about it here.
For if-conditions that break or continue a loop or return from a function, it often improves readability to move them into seperate conditions instead of an if ... elif ... elif ... else construct.
user_guess.islower() == False is equivalent to not user_guess.islower(), and even better user_guess.isupper().
When checking if user input is not a letter, you should use not user_guess.isalpha() instead of only checking for numbers with user_guess.isnumeric().
tries = tries - 1 is equivalent to tries -= 1.
Imports should usually be found at the top of your code file.
We only need to update dashes if the user_guess is in secret_word.
The length of secret_word will probably never be performance-critical. In general, if we need to perform multiple (performance-critical) membership tests (e.g. letter in word), sets provide lookups in constant instead of linear time.

Here's the full code without comments:
from random import choice


class Dashes:
    PLACEHOLDER = &quot;-&quot;

    def __init__(self, secret_word):
        self.secret_word = secret_word
        self.letters = [self.PLACEHOLDER] * len(secret_word)

    def update(self, guess):
        for index, letter in enumerate(self.secret_word):
            if letter == guess:
                self.letters[index] = guess

    def is_completed(self):
        return self.PLACEHOLDER not in self.letters

    def __str__(self):
        return &quot;&quot;.join(self.letters)


def get_guess():
    while True:
        user_guess = input(&quot;Guess a letter: &quot;)

        if not user_guess.isalpha():
            print(&quot;That is not a letter!&quot;)
            continue

        if len(user_guess) != 1:
            print(&quot;You can only enter one letter!&quot;)
            continue

        if user_guess.isupper():
            print(&quot;Remember to enter a lowercase letter, but I'll swap it for you this time :)&quot;)
            return user_guess.lower()

        return user_guess


def main():
    words = [&quot;jazz&quot;, &quot;hello&quot;, &quot;bird&quot;, &quot;birds&quot;, &quot;peanut&quot;, &quot;butter&quot;, &quot;cake&quot;, &quot;hallway&quot;]
    secret_word = choice(words)

    dashes = Dashes(secret_word=secret_word)

    tries = 10

    while tries &gt; 0 and not dashes.is_completed():
        print(dashes)
        user_guess = get_guess()

        if user_guess in secret_word:
            print(&quot;That letter is in the secret word!&quot;)
            dashes.update(user_guess)
        else:
            print(&quot;That letter is not in the secret word.&quot;)
            tries -= 1
            print(f&quot;You have {tries} tries left.&quot;)

    if dashes.is_completed():
        print(dashes)
        print(f&quot;You guessed correctly, the word was {secret_word}!&quot;)
        print(&quot;--------------------------YOU WIN!----------------------------&quot;)
    else:
        print(f&quot;You ran out of guesses, the word was {secret_word}.&quot;)
        print(&quot;--------------------------YOU LOSE----------------------------&quot;)


if __name__ == &quot;__main__&quot;:
    main()