Need more help understanding strings

I understand that strings are a string of characters and locked in memory yet what is their purpose? Why do we use
word=“word”
rather than
word=word

The computer needs extra help to understand what we are saying.
So does “word=word” mean that you want to assign the value of the variable word to word?
Or do you want to assign 4 characters comprised of w o r d to word?
It doesn’t understand so it needs the double quotes to know that you want a ‘literal string’ comprised of the letters w o r d to be assigned to a variable (which is essentially a space in memory) that you have called word.

hope this helps.

2 Likes

A string is basically any type of text. A variable will not consider word = word because by default variables store numbers. You have to indicate the data type that you’d like, in this case a string(text) so that the compiler does not confuse or display an error.