Is there any difference between:
print "I am John Doe\'s cousin."
and:
print "I am John Doe's cousin."
When you use the line with out the \' and if you wrote it using single quotation marks(an apostrophe) python would read the line as
print ('I am doe')
then would give an error because python doesn't expect anything after the apostrophe
when you use a backslash python takes the apostrophe as a string and not an end of string
when you use the regular quotation mark it doesn't matter, python will read it the same
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With