Python Function: Print in Caps

Prompt

write a print function all in caps.
Python

Result

Sure, here is a Python function that prints a string in all caps. I've included comments and a docstring to explain what the function does.

def print_in_caps(message):
    """
    This function takes a string as input and prints it in all capital letters.
    
    Args:
    message (str): The string to be printed in capital letters.
    
    Returns:
    None
    """
    # Check if the input is a string
    if isinstance(message, str):
        # Convert the string to uppercase
        message = message.upper()
        # Print the uppercase string
        print(message)
    else:
        print("Invalid input. Please enter a string.")
Python

You can use this function like this:

print_in_caps("hello world")
Python

This will output:

HELLO WORLD