I can't make the function completely correct

前端 未结 2 1882
暖寄归人
暖寄归人 2021-01-28 09:22

Hi I am really confused in this one, it is very hard for me to make the part \'we\'re done\'. Only when I run the code, the result would only be [\'Hooray\', \' Finally\']

2条回答
  •  梦谈多话
    2021-01-28 09:45

    This line:

    string+char
    

    is computing something, but not assigning it.

    Try this instead:

    string=string+char
    

    Or, you can shorten it to use += shorthand:

    string += char
    

    Which is equivilent to the above.

提交回复
热议问题