When I tested with 2 words "python" and "air", the result was:
"ythonpay"
"iraay" (this is not correct, it should output airway)
I think the code should be like this
if word[0].lower() in 'aeiou':
output = f'{word}way'
return output + punctuation
output = f'{word[1:]}{word[0]}ay'
return output + punctuation
or
if word[0].lower() in 'aeiou':
output = f'{word}way'
else:
output = f'{word[1:]}{word[0]}ay'