Print python code for \t escape character?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jeremy Rohrer
    New Member
    • Oct 2010
    • 6

    Print python code for \t escape character?

    What is the python code for printing this sentence? "The \t is the tab escape character."
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    To print a backslash character: print "\\"

    Comment

    • Jeremy Rohrer
      New Member
      • Oct 2010
      • 6

      #3
      Thanks man, but I need to know how to print out that sentence so it looks the exactly same way in my script.

      I want it to look like this: The \t is the tab escape character.

      Whenever I do it though it looks like this:
      The is the tab escape character.

      Thanks for your help.

      Comment

      • bvdet
        Recognized Expert Specialist
        • Oct 2006
        • 2851

        #4
        I gave you the answer, you just did not think about it. Add a backslash in front of the tab character.

        If you are in Python 3, print is a function instead of a statement.

        Comment

        • Jeremy Rohrer
          New Member
          • Oct 2010
          • 6

          #5
          my fault. thank you.

          Comment

          • bvdet
            Recognized Expert Specialist
            • Oct 2006
            • 2851

            #6
            No problem. I am glad to help. :)

            Comment

            Working...