Header Ads

Write a function that stutters a word as if someone is struggling to read it. The first two letters are repeated twice with an ellipsis ... and space after each, and then the word is pronounced with a question mark ?


Example:
stutter("incredible") ➞ "in... in... incredible?" 
stutter("enthusiastic") ➞ "en... en... enthusiastic?" 
stutter("outstanding") ➞ "ou... ou... outstanding?"

Code:

def stutter(word):
s = word[:2]
return (2 * (s + '... ')) + word + '?'


print(stutter("incredible"))

Output:

in... in... incredible?

Post a Comment

0 Comments