After writing the code in Python, you have to save your file in the .py format.
Now, you have to open the terminal by pressing Ctrl+Alt+T.
After that, you can navigate the terminal to the directory where the .py file is located using the following:
After setting the path, in the terminal, you can write the following to execute the script:
If your script is written in Python3, then you should write:
If you are looking for an online course to learn Python, I recommend this Python Course by Intellipaat.