3 odpowiedzi
+ 2
You need ' or " to make a string. What you use is a matter of style or convention both will work, just use them consistenly. ("this' is no good)
I think mostly " are used for strings that represent sentences in human language like
"hello world"
and ' are used for more abstract strings like single charaters etc.
+ 2
Text (strings) are always inside " or '. But make sure to use the same one as the start and end!
"String"
+ 1
You can use single or double inverted comma's to create string .but if you want to do tricks with your String then you can try both.
e.g=
x=('"Hi"')
print(x) output="Hi" because "" is also a string here.