Writing text on multiple lines in an error message

I would like to know if it is possible to write multiple lines of text (with each sentence appearing on a new line) in an error message.

I have tried the following code to achieve this, but have been unsuccessful:

import streamlit as st  

st.error("Line 1a\n"
         "Line 2b.")

st.error("Line 1c\n Line 2d.")

@rik try like this β€˜β€™β€™ line 1
line 2
line 3
β€˜β€™β€™

like
st.write(β€˜β€™β€˜# San Francisco Crime Classification
This app predict top 5 crime in San Francisco.
β€˜β€™β€™)

@MuhammadAmmar26627 I tried that and it did not work.
FYI it is with the st.error method that I would like to display text with, not st.write

@rik This will do

st.error('''
Line 1  
Line 2
''')

The thing is in Markdown leave 2 spaces and go to the next line will add a new line. In the code, I have added 2 spaces after Line 1.

5 Likes