12 loops and arrays


#1

var names = ["andy", "ben", "sam","tim","amanda"];

for (var i = 0; i < names.length; i++}{
console.log("I know someone called" +" " + names[i]);
}

anyone kind can help with this .......
this drives me crazy
i don't know what is wrong


#2

This looks like javaScript not Python and what is wrong with it? What is the error message? From first glance it seems to be ok maybe you just need to refresh the page or read the instruction carefully.


#3

@boardblaster29586,

If using javascript , you should close the for-loop-condition with a closing-parentheses-)
like

 for (var i = 0; i < names.length; i++) {

If using python

var names = ["andy", "ben", "sam","tim","amanda"];

for key in names:
    print "I know someone called" +" " + key

#5

i practice the java script and python the same time so might confuse sometime. :joy:
Thank you for the help!