Learn more about Python!

Python

Facts About Python

Initial Release

Python, a powerful and versatile programming language, was created in 1991 by Guido van Rossum to prioritize code readability and simplicity, enabling programmers to convey ideas more succinctly than in other languages.

Powerful Syntax

Python boasts a highly powerful and expressive syntax that enables you to convey a considerable amount of logic with minimal code. Below, you will find advanced and impactful Python syntax features accompanied by clear examples that illustrate their strengths.

Multiple implementations

The original Language (CPython) is not the only implementation; everything is explained in the Table Chart below

Implementation Description
CPython Standard (C-based)
PyPy JIT-compiled
Jython Runs on JVM
IronPython Runs on .NET

Popularity

According to the internet, the number of developers who are using Python is 8.2 million worldwide. And the reason behind that is that Python is so easy to learn and is the most effective and influential language in the history of coding. Developers use it for:

  • Web development (websites & servers)

  • Artificial Intelligence & Machine Learning

  • Data science & data analysis

  • Games

  • Automation & scripting

  • Cybersecurity & hacking tools

  • Desktop applications

Python Examples

 

Hello + Variable

name = “Python”
year = 2025

print(“Hello”, name)
print(“Year:”, year)

Simple Calculator

a = 10
b = 5

print(“Add:”, a + b)
print(“Multiply:”, a * b)

If / Else Desicion

age = 16

if age >= 18:
print(“Adult”)
else:
print(“Minor”)

Loop Through Numbers

for i in range(1, 6):
print(i)

Function Example

def greet(name):
return f”Hello, {name}!”

print(greet(“Name”))

List Comprehension + Condition

numbers = range(1, 21)
even_squares = [x*x for x in numbers if x % 2 == 0]

print(even_squares)

Dictionary Counting (Frequency Map)

text = “python is powerful and python is easy”
words = text.split()

count = {}
for word in words:
count[word] = count.get(word, 0) + 1

print(count)

Class (Object-Oriented Programming)

class User:
def __init__(self, name, level):
self.name = name
self.level = level

def level_up(self):
self.level += 1

player = User(“Younis”, 10)
player.level_up()

print(player.name, player.level)

File Read & Write

with open(“data.txt”, “w”) as f:
f.write(“Python is powerful”)

with open(“data.txt”, “r”) as f:
print(f.read())

Async Code (Advanced)

import asyncio

async def task(name):
await asyncio.sleep(1)
print(f”Task {name} done”)

async def main():
await asyncio.gather(
task(“A”),
task(“B”)
)

asyncio.run(main())

|
|
|
|
|

|
|
|
|
|

|
|
|
|
|

|
|
|
|
|

|
|
|
|
|

|
|
|
|
|

|
|
|
|
|

|
|
|
|
|

|
|
|
|
|

|
|
|
|
|

|
|
|
|
|

|
|
|
|
|

|
|
|
|
|

|
|
|
|
|

|
|
|
|
|