What is different mean ' or " ? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 3

What is different mean ' or " ?

9th May 2018, 5:16 PM
Seung-Gyeom Gwon
Seung-Gyeom Gwon - avatar
7 ответов
+ 4
In C-style languages ' denotes a character and " denotes a string. In Python there is no difference except that 's can be included in "s (print("My phone's battery isn't very good")) and "s can be included in 's (print('A great person once said "With great power comes great responsability" ').
9th May 2018, 5:24 PM
Vlad Serbu
Vlad Serbu - avatar
+ 11
as Toni Isotalo said its depends on the languages C: Single quotes are characters ( char ), double quotes are null-terminated strings ( char * ). Single quotes are for a single character. Double quotes are for a string (array of characters). You can use single quotes to build up a string one character at a time, PHP: It is slightly faster to use single quotes. PHP won't use additional processing to interpret what is inside the single quote. when you use double quotes PHP has to parse to check if there is any variables in there. A single-quoted string does not have variables within it interpreted. JAVASCRIPT: There is no special difference between single and double quotes (like it is in PHP). The only actual difference is that you can write a double quote " in a single-quoted string without escaping it, and vice versa. They work the same, but they must match. JAVA: Use single quotes for literal char s, double quotes for literal String s, like so: char c = 'a'; String s = "hello"; They cannot be used any other way around (like in Python, for example). A char is a single UTF-16 character, that is a letter, a digit, a punctuation mark, a tab, a space or something similar. SQL: You can store string with single and double quotes. But... single quotes are used to indicate the beginning and end of a string in SQL. Double quotes generally aren't used in SQL, you use them in order to store lets say the whole SQL statement(query), in a variable so you can use it later in your code.
9th May 2018, 5:30 PM
Scooby
Scooby - avatar
+ 4
depends on the language
9th May 2018, 5:19 PM
Toni Isotalo
Toni Isotalo - avatar
+ 3
Awsome!!! I wonder it in Python. I really understand it now. Thank you for your answer.
9th May 2018, 5:41 PM
Seung-Gyeom Gwon
Seung-Gyeom Gwon - avatar
+ 2
>>print('Hello') Hello >>print("Hello") Hello
9th May 2018, 5:24 PM
Seung-Gyeom Gwon
Seung-Gyeom Gwon - avatar
+ 1
Wow :0, Thanks you.
9th May 2018, 5:27 PM
Seung-Gyeom Gwon
Seung-Gyeom Gwon - avatar
+ 1
depends upon the platform you are using.. u will be familiar when you start to use the particular language
10th May 2018, 12:21 AM
Shrestha Bibash
Shrestha Bibash - avatar