Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7497223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:59:14+00:00 2026-05-29T18:59:14+00:00

I use the triple string in the following way: str=jeff str=jeff str=jeff # error

  • 0

I use the triple string in the following way:

str="""jeff"""
str=""""jeff"""
str=""""jeff""""   # error
str=""""jeff """"

The third one is error, could anyone explain why this is error ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:59:16+00:00Added an answer on May 29, 2026 at 6:59 pm

    Three quotes terminate a string, so this

    str=""""jeff""""
    

    is parsed as this:

    str= """ ("jeff) """ (")
    

    The trailing quote is the problem.

    BTW, looking at the BNF definition

    longstring      ::=  "'''" longstringitem* "'''"
                         | '"""' longstringitem* '"""'
    

    it’s obvious that the star * is non-greedy, I don’t know though if this is documented somewhere.

    In response to the comment, this

     str = ''''''''jeff'''
    

    is interpreted as

    (''')(''')('')(jeff)(''') <-- error, two quotes
    

    and this

     str = '''''''''jeff'''
    

    is interpreted as

     str = (''')(''')(''')(jeff)(''') <-- no error, empty string + jeff
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move
use this website a lot but first time posting. My program creates a number
I intend to use TripleDES in one of my project. I was doing some
When does using pointers in any language require someone to use more than one,
Howto use sed to remove only triple empty lines? For example: MyText.txt line1 line2
We have a locally-developed triple store based on b-trees which I want to use
What's the best way in java to store data triple in a list ?
There must be an easy way to do this, but somehow I can wrap
I have a directory structure in my project (something) similar to this one: Root
Is this possible in C#? How would I accomplish this? Two-key triple DES is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.