Quotes | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Quotes

How to write a statement quote of a third party without a syntax error. Eg, Mr John's brother said " are you happy?" I need the print statement

13th Jul 2022, 9:46 PM
Jordan Alloy ✝️
Jordan Alloy ✝️ - avatar
3 Answers
+ 8
Inside of "" you have to escape another " in order not to close the quotation and instead print a literal ". So for example: print("Mr. John's brother said \"are you happy?\"") I believe you can use single quotations literally without escaping inside of double quotes, and vice versa: print('Mr. John\'s brother said "are you happy?"')
13th Jul 2022, 9:56 PM
ρү૨œdԌ૨ ×
ρү૨œdԌ૨ × - avatar
+ 2
ρү૨œdԌ૨ × thanks alot. You solved my problem
13th Jul 2022, 9:59 PM
Jordan Alloy ✝️
Jordan Alloy ✝️ - avatar
+ 1
You're welcome 😀
13th Jul 2022, 10:02 PM
ρү૨œdԌ૨ ×
ρү૨œdԌ૨ × - avatar