Answered step by step
Verified Expert Solution
Question
1 Approved Answer
WRITE A FUNCTION FOR EACH OF THE FOLLOWING TASKS ( 1 0 0 Pts ) ( a ) ( 1 0 Pts ) [ Task
WRITE A FUNCTION FOR EACH OF THE FOLLOWING TASKS Pts
a PtsTask Define a function called repeatletters that takes a string and a number as two parameters and prints the string with every letter repeated times.
Sample inputOutput:
printrepeatlettersmedipol
"mmmeeeddiiipppooolll"
b PtsTask Define a function called findindex 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 inputOutput:
printfindindexwelcomehomee
c PtsTask Define a function called listunique 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 inputOutput:
printlistuniqueankara
d PtsTask Write a function called ngramslist that takes a string and a number and return the grams of the this string as a list
Sample inputOutput:
printngramslistcomputercoommppuutteer
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started