0
can anyone explains how to write the code of the double quote strings I'll be thankful for you
I need an explanation not answer 😁
8 ответов
+ 4
double quote is special character, thus it has to be escaped. so string should be in quotes and if the string itself contains special characters, all of them should be escaped with backslash, thus " \" " is correct answer. if you need a string which contains just single backslash, then it will be like this "\\"
+ 1
both the lines do not contain any special characters, so it would be usual print with \n as new line.
another option is using triple quotes
0
ok say that I wanna type this string
me : hello sir
the officer : hello!!!
how my code will look like ?
0
it would look like this.
print("me:hi")
print("the officer: hello")
0
print("me: hello sir")
print("the officer : hello!!!)
0
You basically just put print and right in front of print you put parentheses. When you do that you're telling the computer you want something outputed. Then you put quotes within the parentheses so then you're telling the computer you want specific words outputed.
0
print("me : hello sir")
print("the officer : hello!!!")
0
Ok how about the sentence like this
Tom's teacher: He's not a bad boy.!
He's very smart