0
string means just the sentence including quotation marks. For example "hello world" double quote means using ". single quote means '. Can someone tell me if the concept is right??
4 odpowiedzi
+ 1
Yep. String is for representing text, and you put the text between a pair of quotes or double-quotes.
+ 1
Concept's fine for these string literal types. What's nice about them is they allow naturally embedding the other type:
"This string's got an apostrophe inside."
'This string has "double quotes" inside'
0
a string can be either double or single qoute marks, but can not be double or single together. "string" or 'string' are both correct but "string' will not work.
- 1
If we use single quotes... We have to give prefix as print. for eg: print 'hello word'...... Also if we want to use double quotes.. Its simply "hello word"