Functions are a convenient way to divide your code into useful blocks, make it more readable and reuse it. Functions are defined using the keyword "def", followed with the function's name.

Define a function to replace duplicated lines in file.