There is no difference in Python, and you can take advantage of it when creating XML. The correct XML syntax requires double quotes around attribute values, and in many languages, such as Java, this forces you to avoid them when creating such a string:
String HtmlInJava = "<body bgcolor=\"Pink\">"
But in Python, you just use a different quote and don't forget to use the appropriate quote quote as follows:
html_in_python = '<body bgcolor="Pink">'
Pretty nice, huh? You can also use three double quotes to start and end multiline strings, with EOL included as follows:
multiline_python_string = """ This is a multi-line Python string which contains line breaks in the resulting string variable, so this string has a '\n' after the word 'resulting' and the first word 'word'."""
Steve Moyer Sep 27 '08 at 14:46 2008-09-27 14:46
source share