Loop string array

I having trouble outputting:
“ The main color of grapes is purple.”
“The main color of apples is red.”
“The main color of limes is green.”
“The main color of lemons is yellow.”

My output keep printing:
The main color of grapes is purple. 4 time. HELP PLZ!

randomThings[j] + " is " + colors[j]
Also remove your if condition

1 Like

Thanks for the hint but I’ve tried that it still print out multiple line, when i just needed to print out 4 line only.

Hey @jeanlaurore101,

What does it print now? Maybe you can deduct the error from the given output?

If you can’t figure it out, don’t hesitate to post the output and your code here (using the </> button) and we will have a look at it.

1 Like

I got it to work thank you. I appreciate it @janneslohmeijer

1 Like