Data Structure.14


#1

How is this not an array?

my_array = [[Seb, Nephew], [Luchi, Godchild], [Lisa, Mom]]


#2

Same here I am inputting:

my_array = [[jordan, pippen], [lebron, bryant]]

It isn't working... ? How are these not viable strings for an array? Seems kind of restricted to me.. and ontop of that there is little information provided saying otherwise!


#3

Hi OPDL and @rvhul,

That is an array, but you both seem to be forgetting the difference between a string and a variable - it's not much:

"string"
variable

Yeah. It's only the quotes that differentiate a string from a variable. Your code is looking for a variable called Seb, or a variable called Nephew, and not finding one. If you your strings in quotes, they'll become strings and your troubles should vanish :)


#4

4 posts were split to a new topic: Oops, try again. Did you declare an array called my_array?


#5

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.