Unable to submit this answer for "Scala - Assessment - Declare an Iterator",

Hello Cloudxlab,

Unable to submit this answer for “Scala - Assessment - Declare an Iterator”, please let me know what is wrong in this code

tried with hint and also spend points for answer
Nothing is working

var myIter = Iterator(“I”, “am”, “going”)
while (myIter.hasNext){
println(myIter.next())
}

Because of this my course completion was 98% will this impact to get certificate ??

Jupyter notebook its giving output as :

I
am
going
myIter = empty iterator
Out[2]:empty iterator

Please help me another 2 days my subscription is going to end.

Thanks& Regards,
Santosh Kumar Myakala

Hi, Santosh.

Please look the variable as below.
var myIter = Iterator(“I”, “am”, “going”)

Now you will be able to do it.

All the best

Hi Satyajit,

Thank you for your reply, can you please refer my post.

Regards,
Santosh

Hi, Santosh.

Can you please look at the question, you will be able to do it.
It just require to declare an Iterator in scala having the elements as (“I”,“am”,“going”).
var myIter = Iterator(“I”, “am”, “going”)

Please do not run the while loop for accessing it, we are just declaring the variable.

All the best.