+ 1

In chapter "strings" in the first part of it has a code in which the string is written in single inverted coma

in description it's written that we should write string in double inverted coma but in code it's opposite >>> 'Always look on the bright side of life' 'Always look on the bright side of life'

17th Jun 2018, 8:30 AM
Shashi Ranjan
Shashi Ranjan - avatar
7 odpowiedzi
+ 2
they were just tryna show us that the compiler accepts strings in both ways, whether using double quotes or single quotes, but not both at the same time. e.g: a = ' this is me '(correct) a = "this is me"(correct) a = "this is me '(wrong)
17th Jun 2018, 8:43 AM
ghali lawal
ghali lawal - avatar
+ 1
but three single quotes represent a doc string( a comment written on multiple lines
17th Jun 2018, 8:47 AM
ghali lawal
ghali lawal - avatar
+ 1
my pleasure
17th Jun 2018, 8:47 AM
ghali lawal
ghali lawal - avatar
0
we can use double quotes as many as we want?
17th Jun 2018, 8:45 AM
Shashi Ranjan
Shashi Ranjan - avatar
0
yeah
17th Jun 2018, 8:46 AM
ghali lawal
ghali lawal - avatar
0
thanks
17th Jun 2018, 8:47 AM
Shashi Ranjan
Shashi Ranjan - avatar
0
I see
17th Jun 2018, 8:48 AM
Shashi Ranjan
Shashi Ranjan - avatar