TabError: inconsistent use of tabs and spaces in indentation

I am getting an error message that says “inconsistent use of tabs and spaces in indentation” in my Python code. I have tried to fix the indentation, but the error persists. Can anyone help me figure out what is causing this error and how I can fix it?

When I run the below code, I get the following error message:

TabError: inconsistent use of tabs and spaces in indentation

Here is the code that is causing the error:


def my_function():
    if True:
        print("Hello!")
            print("World!")

I’m not sure how to fix this error. Can someone explain what is causing it and how to resolve it? Thank you for any help you can provide.