How do you ensure that a word taken in through a function repeats each of its alphabets in the output.
def word("Hello") should return
def word("Hi-Tech") should return
This should do the trick.
def word(txt): new_txt = "" for letter in txt: new_txt += letter*2 return new_txt
Basically, for every letter, you add 2 of the letter (
letter*2) to a string, which you return at the end.