Skip to content

python get started documentation #599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/python/getting-started-py.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<b>1.Download Python:</b> 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)

<b>2.Choose the Version:</b> 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).

<b>3.Add Python to PATH (Optional):</b> 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.

<b>4.Install Python:</b> Click the “Install Now” button to begin the installation. The installer will copy the necessary files to your computer.
![alt text](image-2.png)

<b>5.Verify the Installation:</b> 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!

```

Binary file added docs/python/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/python/image-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/python/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/python/intro-py.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <mark>Guido van Rossum</mark> 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.

Expand Down
Loading