Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Immanity |
I have an array of:
var lines = [acerola, apple, apricots, avocado, banana, blackberry, blackcurrant, blueberry, breadfruit, cantaloupe, carambola, cherimoya, cherry, clementine, coconut, cranberry, durian, elderberry, feijoa, fig, gooseberry, grapefruit, grape, guava, jackfruit, kiwifruit, kumquat, lemon, lime, longan, loquat, lychee, mandarin, mango, mangosteen, mulberry, nectarine, olives, orange, papaya, peach, pear, persimmon, pineapple, pitanga, plantain, plum, pomegranate, prune, pummelo, quince, raspberry, rhubarb, sapodilla, soursop, strawberry, tamarind, tangerine, watermelon]
and my script is:
var letter = "a"
var possible_answer = []
for answer in lines:
if (answer[0] == letter):
possible_answer.append(answer)
print(possible_answer)
then when I run my code it shows "Invalid get index “0” (on base:‘String’)
I am thinking if the editor is the problem because I use the new godot 3.2 Aplha!
Can you please help me!!!