def my_print(text, begin, end):
    """Print text in UPPER between 'begin' and 'end' in lower."""
for obj in (text, begin, end):
    assert isinstance(obj, str), 'Argument of wrong type!'
print(begin.lower() + begin.upper() + end.lower())
Proper way to assert type of variable in Python