Se încarcă problema…
In a user interface, people usually see clear words instead of raw boolean values. Write bools_to_words, which takes a list arr and replaces each True with the string Yes and each False with the string No. The order of the elements must stay the same.
[True, False]["Yes", "No"][][][True, True, True]["Yes", "Yes", "Yes"]def bools_to_words(arr: list) -> list[str]:
Conectează-te pentru a vedea istoricul soluțiilor trimise
Conectează-teConectează-te pentru a folosi Mentorul AI
Conectează-te[true,false]["Yes","No"][][][true,true,true]["Yes","Yes","Yes"][false,false]["No","No"][false,true,false,true]["No","Yes","No","Yes"][true]["Yes"]