You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Language/Python/Python.md
+91-3Lines changed: 91 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,96 @@ has_children: false
9
9
{{ page.title }}
10
10
======================
11
11
12
-
{% include under_construction.html %}
12
+
Python is a general-purpose programming language, which means it can be used for a wide range of applications, including web development, data science, artificial intelligence, machine learning, automation, scientific computing, and more. Python's simplicity, readability, and versatility have contributed to its widespread adoption in both the development community and various industries.
- Object-Oriented Programming (OOP): Python supports object-oriented programming (OOP) principles, allowing developers to use classes and objects to structure their code.
25
+
26
+
- Interpreted and High-Level: Python is an interpreted language, meaning that the source code is executed line by line, making it easy to test and debug. It is also considered a high-level language because it abstracts many low-level details, making it more readable and easier to learn.
27
+
28
+
- Dynamic Typing: Python is dynamically typed, which means you don't need to explicitly declare the data type of a variable. The interpreter determines the type during runtime.
29
+
30
+
- Indentation and Readability: Python uses indentation (whitespace at the beginning of a line) to define blocks of code. This indentation-based syntax enforces a clean and readable code structure.
31
+
32
+
- Extensive Standard Library: Python comes with a vast standard library that includes modules and packages for various tasks, from working with files and networking to handling regular expressions and more. This helps developers avoid "reinventing the wheel" for common functionalities.
33
+
34
+
- Versatility and Portability: Python is platform-independent, meaning Python code can run on various operating systems without modification. This portability makes it an excellent choice for cross-platform development.
There are two major versions of Python currently in use:
41
+
42
+
- Python 2: Python 2 was the original version of Python and was released in the early 2000s. It gained widespread popularity and was used for many years in various projects and applications. It reached its end-of-life on January 1, 2020. This means that no official support, including security updates, bug fixes, or other improvements, are provided by the Python Software Foundation. In Python 2, strings are ASCII by default, and handling Unicode required additional considerations. There are some other semantic differences as well.
43
+
44
+
- Python 3: Python 3 was released as a significant improvement over Python 2, addressing various design flaws and providing a more modern and consistent language, as well as improved security and performance. Python 3 is not backward compatible with Python 2 - This means that code written for Python 2 may need modifications to run on Python 3. There were also other various syntax improvements and changes to the standard library. These changes aimed to make the language more readable, consistent, and efficient.
There are several steps you can take to begin learning and using the language. Here's a step-by-step guide:
51
+
52
+
1.### Download Python
53
+
54
+
Visit the [Official Python Website](https://www.python.org/downloads/) and download the latest version of Python.
55
+
56
+
2.### Installation
57
+
58
+
Follow the installation instructions for your operating system. Make sure to check the box that says `"Add Python to PATH"` during installation for easier command-line access.
59
+
60
+
3.### Choose an Integrated Development Environment (IDE)
61
+
62
+
You'll then need to select an IDE or a text editor to write your Python code. Some popular options include:
63
+
64
+
- Visual Studio Code: A lightweight and extensible code editor with Python support.
65
+
- Sublime Text:
66
+
- Atom:
67
+
- PyCharm: A more feature rich IDE specifically for Python.
68
+
69
+
3.### Write Python Code
70
+
71
+
Simply create a new Python source file (typically with a .py extension) using your chosen IDE or text editor, and write your C++ code using the C++ syntax and features!
72
+
73
+
Here's a simple "Hello, World!" program:
74
+
75
+
```python
76
+
print("Hello, World!")
77
+
```
78
+
79
+
Yeah... it's that easy!
80
+
81
+
4.### Save
82
+
83
+
Save your Python code with a meaningful filename and the .py extension.
84
+
85
+
5.### Run the Code
86
+
87
+
Use the command-line interface or the terminal to run your python code. Run the program by navigating to the folder with your file and typing:
88
+
89
+
```bash
90
+
python hello_world.py
91
+
```
92
+
93
+
OR (on some systems)
94
+
95
+
```bash
96
+
python3 hello_world.py
97
+
```
98
+
99
+
Notice how you do not need to compile it like in some other languages (such as C++). This is because Python code is executed directly by an interpreter without the need for a separate compilation step.
0 commit comments