Question: ( a ) ] Define a function called repeat _ letters that takes a string and a number n as two parameters and prints the

(a)] Define a function called repeat_letters that takes a string and a number n as two parameters and prints the string with every letter repeated n times.
Sample input/Output:
print(repeat_letters("medipol",3))
"mmmeeedddiiipppooolll"
(b)
Define a function called find index which takes as argument a word and a letter. It will return the index of the second occurrence of the letter in the given word.
Sample input/Output:
print(find_index("welcomehome","e"))
6
(c) Define a function called list_unique that takes a string str as an input, checks all letters of the string, and constructs a list that contains the list of character that appear in str. This list should not contain any duplicates.
Sample input/Output:
print(list_unique("ankara"))
['a','n','k','r']
(d)
' Write a function called ngrams_list that takes a string and a number n and return the n-grams of the this string as a list
Sample input/Output:
[["co","om","mp","pu","ut","te","er"]
2
 (a)] Define a function called repeat_letters that takes a string and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!