Predict the result... By Benji '24
def decayed_word(word):
result = ""
for i in range(len(word)):
if i % 2 == 0:
result = result + word[i]
return result
| Function Call | Return Value | |||
|---|---|---|---|---|
| decayed_word("Hello") | → | |||
| decayed_word("World") | → | |||
| decayed_word("Hi, I am me :)") | → | |||
| decayed_word("AAAAaAA") | → | |||
Experiment with this code on Gitpod.io