Skip to content

Commit 0dac8f7

Browse files
authored
Merge pull request #599 from dhairyagothi/main
python get started documentation
2 parents 2ac9f3d + 4ba985b commit 0dac8f7

File tree

5 files changed

+50
-0
lines changed

5 files changed

+50
-0
lines changed

docs/python/getting-started-py.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,52 @@ sidebar_position: 2
66
tags: [python]
77
description: In this tutorial,
88
---
9+
10+
11+
Here’s a basic guide to get you started with Python:
12+
13+
## Install Python
14+
15+
First, you need to install Python on your computer. To install Python on your computer, follow these steps:
16+
17+
<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.
18+
![alt text](image-1.png)
19+
20+
<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).
21+
22+
<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.
23+
24+
<b>4.Install Python:</b> Click the “Install Now” button to begin the installation. The installer will copy the necessary files to your computer.
25+
![alt text](image-2.png)
26+
27+
<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.
28+
29+
That’s it! Python should now be installed on your computer, and you’re ready to start using Python.
30+
31+
## Setting up a Python Development Environment
32+
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.
33+
34+
## Create and Run your First Python Program
35+
For the first program, we will try to print a very simple message “Hello World” in Python, the code for which is given below:
36+
37+
Once you have Python installed, you can run the program by following these steps:
38+
39+
- Open a text editor (e.g., Notepad on Windows, TextEdit on macOS, or any code editor like VS Code, PyCharm, etc.).
40+
- Copy the code above and paste it into the text editor.
41+
- Save the file with a .py extension (e.g., hello_world.py).
42+
- Open a terminal or command prompt.
43+
- Navigate to the directory where you saved the file using the cd command (e.g., cd path/to/your/directory).
44+
- Run the program by typing python hello_world.py and pressing Enter.
45+
46+
You should see the output “Hello, World!” printed in the terminal.
47+
48+
```python title="hello.py"
49+
# Print a message to the console
50+
print("Hello, World!") # Output: Hello, World!
51+
52+
# Define a variable and print its value
53+
message = "Hello, Python!"
54+
print(message) # Output: Hello, Python!
55+
56+
```
57+

docs/python/image-1.png

244 KB
Loading

docs/python/image-2.png

211 KB
Loading

docs/python/image.png

322 KB
Loading

docs/python/intro-py.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ sidebar_position: 1
66
tags: [python, programming, language, introduction, syntax, features, applications, libraries, community, open-source, object-oriented, interpreted, cross-platform, scalable]
77
description: In this tutorial, we will learn about Python, its features, syntax, applications, libraries, and community support.
88
---
9+
![alt text](image.png)
910

1011
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.
1112

0 commit comments

Comments
 (0)