#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
    439
    Rep Power
    67
    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: openSUSE 13.2 (home desktop, work desktop), openSUSE 13.1 (home laptop), Debian GNU/Linux 7.7.0 (mini laptop), Ubuntu 14.04 LTS (server), Android 4.2.1 (tablet), Windows 7 Ultimate (testbed)
  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