#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    6
    Rep Power
    0

    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 "?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2007
    Location
    Joensuu, Finland
    Posts
    469
    Rep Power
    68
    Originally Posted by Nibur
    How shall i do to be able to print "?
    Either alternate single and double quotes or use \ to quote the quote character:

    Code:
    print('Hello "Hank", you are the best')
    print("Hello \"Hank\", you are the best")
    My armada: Debian GNU/Linux 8 (desktop, home laptop, work laptop), Raspbian GNU/Linux 8 (nameserver), Ubuntu 14.04.3 LTS (HTPC), PC-BSD 10.2 (testbed), Android 4.2.1 (tablet)
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    6
    Rep Power
    0
    Thanks!

IMN logo majestic logo threadwatch logo seochat tools logo