92.5k views
1 vote
Help me pls!!

Look at the following assignment statements:

food1 = "water"
food2 = "melon"

What is the correct way to concatenate the strings?

newFood = word1 == word2
newFood = word1 + word2
newFood = word1 * word2
newFood = word1 - word2

User Nicekiwi
by
7.5k points

2 Answers

7 votes

Answer:

new food = word1 + word2

Step-by-step explanation:

User Adlorem
by
7.8k points
4 votes

new food = word1 + word2 will connect both words together with no space in between. The value of newFood will now be "watermelon"

User Kacper Wiszczuk
by
8.1k points