Forum Discussion

chetanhiwale's avatar
chetanhiwale
Resolver I
1 year ago
Solved

Fabric notebook backslash issue

This should print \\n as output. Is this happening due to pylantic or fabric is doing something internally. 

  • When you write a literal like `"\\",` Python processes it as an escape sequence. In this context, a pair of backslashes (`"\\") tells Python to include a single literal backslash in the string.

     

5 Replies

  • When you write a literal like `"\\",` Python processes it as an escape sequence. In this context, a pair of backslashes (`"\\") tells Python to include a single literal backslash in the string.

     

  • v-nmadadi-msft's avatar
    v-nmadadi-msft
    Community Support

    Hi chetanhiwale  ,
    Thanks for reaching out to the Microsoft fabric community forum.

    This is not an issue with Fabric, as this is an expected python output. Any python interpreter will return the same output.
    As nilendraFabric  suggested the code is using an escape character. To insert characters that are illegal in a string, escape characters are used.

    If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS.
    Thanks and Regards

  • v-nmadadi-msft's avatar
    v-nmadadi-msft
    Community Support

    Hi chetanhiwale,

    May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

    Thank you.

     

  • v-nmadadi-msft's avatar
    v-nmadadi-msft
    Community Support

    Hi chetanhiwale,

    I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


    Thank you.

  • v-nmadadi-msft's avatar
    v-nmadadi-msft
    Community Support

    Hi chetanhiwale ,

    As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the community members for the issue worked. If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

     

    Thanks and regards