Oops, try again. It looks like not every element of string_array is a string


#1

Ruby will not allow me to continue on the simplest of codes. This is what i have.

string_array = [5, 6, 7]

Oops, try again. It looks like not every element of string_array is a string.

I have no idea why it is not working. I have tried different combinations, but more errors come up.

Data Structures lesson 3: Arrays of non numbers


#2

As the name would imply, this is meant to be a string array, not a number array.

string_array = ['5', '6', '7']

Strings are always represented in quotes.


#3

Oh, I'm so stupid. Thank you, completely forgot to do that. See this is why i get stuck so much xD


#4

Careful not to beat up on yourself. It's unproductive. Expect to fail and take something from it each time. 'Stupid' people are afraid to fail so they never try, and instead become gleaners. At least you are trying and that's what counts. It takes time to build confidence and knowledge. Keep working at it.