Need more help understanding strings

Need more help understanding strings
0

#1

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


#2

The left side of the = is a variable. Variables hold values such as Strings, Numbers, etc…

If you want to assign the value “word” to a variable named word, then you must write:

word = "word"

#3

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.


#4

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.