February 5th, 2013, 03:12 AM
How do i print "?
When i use " in a text i want to print or when i want to send a sql statment and use ". Se easy example below:
print "Hello "Hank", you are the best"
Then i get error message SyntaxError: invalid syntax.
How shall i do to be able to print "?
February 5th, 2013, 04:14 AM
Either alternate single and double quotes or use \ to quote the quote character:
Originally Posted by Nibur
print('Hello "Hank", you are the best')
print("Hello \"Hank\", you are the best")
My armada: openSUSE 13.1 (home desktop, home laptop), Crunchbang Linux 11 (work laptop), Trisquel GNU/Linux 6.0.1 (mini laptop), Ubuntu 14.04 LTS (server), Android 4.2.1 (tablet), Windows 7 Ultimate (testbed)
February 5th, 2013, 04:16 AM