#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
    428
    Rep Power
    66
    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.1 (home desktop, home laptop), Crunchbang Linux 11 (mini laptop, work laptop), 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