Dec-07-2017, 01:10 PM
Why do you need 'n'?
How to iterate over a string?
How to iterate over a string?
for letter in word: # here the word is whatever word you like. print(letter) # letter is holding the next letter of the word on each iteration.create a variable which will contain the final result and put a '*' in it during the initialization. On each iteration add a letter to it followed by a '*'. and you get the final result as requested. All this inside the function.