diff --git a/docs/python/getting-started-py.md b/docs/python/getting-started-py.md index 8adf53d93..80fa0f98c 100644 --- a/docs/python/getting-started-py.md +++ b/docs/python/getting-started-py.md @@ -6,3 +6,52 @@ sidebar_position: 2 tags: [python] description: In this tutorial, --- + + +Here’s a basic guide to get you started with Python: + +## Install Python + +First, you need to install Python on your computer. To install Python on your computer, follow these steps: + +1.Download Python: Go to the official Python website at https://www.python.org/. On the homepage, you will see a “Downloads” section. Click on the “Download Python” button. +![alt text](image-1.png) + +2.Choose the Version: You will be directed to a page where you can choose the version of Python you want to download. Python usually has two main versions available: Python 3. Python 3 is the recommended version. Click on the appropriate version for your operating system (Windows, macOS, or Linux). + +3.Add Python to PATH (Optional): On Windows, you may be given the option to add Python to your system’s PATH environment variable. This makes it easier to run Python from the command line. If you’re not sure, it’s usually safe to select this option. + +4.Install Python: Click the “Install Now” button to begin the installation. The installer will copy the necessary files to your computer. +![alt text](image-2.png) + +5.Verify the Installation: After the installation is complete, you can verify that Python was installed correctly by opening a command prompt (on Windows) or a terminal (on macOS or Linux) and typing python --version. This should display the version of Python you installed. + +That’s it! Python should now be installed on your computer, and you’re ready to start using Python. + +## Setting up a Python Development Environment +An IDE makes coding easier. Popular choices include PyCharm, Visual Studio Code, and Jupyter Notebook. Install one and set it up for Python development. Or you can also use an online Python IDE. + +## Create and Run your First Python Program +For the first program, we will try to print a very simple message “Hello World” in Python, the code for which is given below: + +Once you have Python installed, you can run the program by following these steps: + +- Open a text editor (e.g., Notepad on Windows, TextEdit on macOS, or any code editor like VS Code, PyCharm, etc.). +- Copy the code above and paste it into the text editor. +- Save the file with a .py extension (e.g., hello_world.py). +- Open a terminal or command prompt. +- Navigate to the directory where you saved the file using the cd command (e.g., cd path/to/your/directory). +- Run the program by typing python hello_world.py and pressing Enter. + +You should see the output “Hello, World!” printed in the terminal. + +```python title="hello.py" +# Print a message to the console +print("Hello, World!") # Output: Hello, World! + +# Define a variable and print its value +message = "Hello, Python!" +print(message) # Output: Hello, Python! + +``` + diff --git a/docs/python/image-1.png b/docs/python/image-1.png new file mode 100644 index 000000000..734862af7 Binary files /dev/null and b/docs/python/image-1.png differ diff --git a/docs/python/image-2.png b/docs/python/image-2.png new file mode 100644 index 000000000..06bb1f278 Binary files /dev/null and b/docs/python/image-2.png differ diff --git a/docs/python/image.png b/docs/python/image.png new file mode 100644 index 000000000..59ed7959d Binary files /dev/null and b/docs/python/image.png differ diff --git a/docs/python/intro-py.md b/docs/python/intro-py.md index 7e5570e51..5f03c4291 100644 --- a/docs/python/intro-py.md +++ b/docs/python/intro-py.md @@ -6,6 +6,7 @@ sidebar_position: 1 tags: [python, programming, language, introduction, syntax, features, applications, libraries, community, open-source, object-oriented, interpreted, cross-platform, scalable] description: In this tutorial, we will learn about Python, its features, syntax, applications, libraries, and community support. --- +![alt text](image.png) Python was created by Guido van Rossum and first released in 1991. Python is an open-source language, which means that the source code is freely available for anyone to use, modify, and distribute. Python has a large and active community of developers who contribute to the language and its ecosystem of libraries and tools.