Getting the correct answer but not the green tick, would appreciate some help

Good afternoon,

Apologies if I’m using this forum incorrectly, I think the forum page linked from the class is closed, see link below.

The lesson is chapter 8, loops, lesson 2, practice makes perfect, slide 10.

We’re tasked with creating a function that takes two arguments, a string and word, and we need to return the string except censoring out the word with the correct amount of stars, to represent each letter.

I would argue my code works correctly but I’m not getting a tick and the bottom console on the text editor screen isn’t showing what I think my function is returning.

I realise I could just view the solution, but I’d prefer to understand why the console is showing something different returned to what is getting printed on the right.

Appreciate any help, sorry if I don’t reply tonight.



You are returning an array when a string is expected.

1 Like

Thank you so much!

1 Like