0

strings & variables part 2

i know that a string is a type of variable but just with quotes. does it help the computer know what is what if there are 2 of the same variable then it will understand which one gets shown up on the screen or...i don't understand this!!! aaaaaaaaaaaaaaaaaahhhhhhhhhhhh!!! if I'm wrong then why do we need strings if its just a variable with quotes why? i want to know because i am making a dictionary for myself and i need this information to continue

22nd Dec 2024, 10:53 PM
print ("python")
print ("python") - avatar
2 Respostas
+ 3
it would help if you clarify what “2 of the same variable” means also, strings are not a variable, they are a data type. they can be stored in variables. a variable has a name and a value (in python). name = value There are also string methods, which perform basic functions used on strings “Strings are like sentences. They are formed by a list of characters, which is really an "array of characters". Strings are very useful when communicating information from the program to the user of the program. They are less useful when storing information for the computer to use.” (from utah edu)
23rd Dec 2024, 3:04 AM
Junior
Junior - avatar
0
Yes, it helps the computer to differentiate if the value that you input is a string or an integer. If you wanted the computer to know which strings or integer should come s first. You will need to create a code or command, specifying what value you wanted to comes first.
23rd Dec 2024, 3:54 PM
Andre Carmona
Andre Carmona - avatar