0
Given a string, return a string where there are three characters for every character in the original.
Example: repeatCharacters('Hello') --> 'HHHeeellllllooo' repeatCharacters ('Mississippi') --> 'MMMiiissssssiiippppppiii'
7 Answers
+ 2
def repeatCharacters(word):
result=""
for letter in word:
result+=letter*3
return result
sample="Hello"
print(repeatCharacters(sample))
#output : HHHeeelllooo
+ 2
Jasy Fabiano thank you
+ 1
You are welcome buddy
0
def reoeat(text):
tripleWord=""
for letter in range(len(text)):
tripleWord = (text[letter]*3)
print(tripleWord)
0
def time_3(letter):
a = []
for i in range(0,len(letter)):
a.append(letter[i]*3)
return ''.join(a)
print(time_3('patel hir'))
ANSWER WILL BE : pppaaattteeelll hhhiiirrr