When building a Streamlit app, the first step is to import the Streamlit module into your app.py file. The app.py file contains the Python code that defines your Streamlit application.
To import Streamlit, add the following statement at the beginning of your app.py file:

This statement imports the streamlit module and assigns it the alias st, allowing you to access Streamlit's functionality using a shorter name.
An alias is an alternative name used to refer to a module in your code. In Python, the as keyword allows you to assign an alias to an imported module.
For example, instead of writing streamlit every time you use its functionality, you can simply use st.
Want to learn how to create an app.py file?
Check out this mini-guide: Build and Deploy a “Hello World” Web App with Streamlit Community Cloud + GitHub.
Comments ()