Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using Python : I would like some assistance with this Funtion from the describe

ID: 3787340 • Letter: U

Question

Using Python : I would like some assistance with this Funtion from the describe information:

Q: Function Design Recipe Following the Function Design Recipe, write a function that satisfies this description: This function returns a string containing a given word repeated a given number of times. For example, someone should be able to call the function to repeat "Marcia " three times and the function should return "Marcia Marcia Marcia ", or call the function to repeat "Buffalo " eight times and have it return "Buffalo Buffalo Buffalo Buffalo Buffalo Buffalo Buffalo Buffalo ".

Explanation / Answer

def func(str,count):
li=[]
for i in range(count):
li.append(str)
return li
  
print func('maria',5)

it will print ['maria', 'maria', 'maria', 'maria', 'maria']

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote