Python Pioneers: A Beginner's Guide πŸ‡ͺπŸ‡Ή
8.83K subscribers
346 photos
40 videos
24 files
64 links
Welcome to Python Pioneers: Empowering Ethiopian students to embark on their coding journey.

πŸ“’ Channel: @python_pioneers
πŸ‘₯ Group: @python_pioneers_chat
Download Telegram
In the tech world, things change fast. Adapting to these changes quickly is what helps us stand out as better programmers. Project changes are tracked using version numbersβ€”and they aren't random. They convey crucial information about the current state of a project.

The Python project uses a major.minor.micro versioning scheme for production releases (the versions we care about most!). Here is how it breaks down:

πŸ”Ή Major version (x.0.0): These are rarely incremented. They only occur when there are significant backward-incompatible changes or a complete, ground-up redesign of the project. These updates are planned years in advance. Python has only had four major versions in its history: 0.x.x, 1.x.x, 2.x.x, and 3.x.x (our current version).

πŸ”Ή Minor version (0.x.0): These are incremented for new features and library deprecations. They can sometimes introduce breaking changes too. In Python's release cycle, a new minor version comes out every year in October.

πŸ”Ή Micro version (0.0.x): These updates are reserved for bug fixes and security patches on an existing minor release.

As of today, the current stable release of Python is Python 3.14.5. 🐍

#GettingToKnowPython #PythonProgramming #CodingTips
❀3πŸ‘2
Lambda functions
Another cool expressions or patterns in python are lambda functions a.k.a anonymous functions. We use them to define functions inline (in one line).
# Syntax
lambda arguments: expresion

The subtle thing we need to understand about anonymous funtions/lambda functions is that they don't have a name unless we explicitly assign them to a variable. The return value of lambda function is the evaluated expression.

The concept actually exists in many programming languages as anonymous functions or function expression, even-though the syntax could be different.
# Examples

# This is valid - With no name
lambda x: x

# With a name
times2 = lambda x: x * 2

# With two argumetns
prefix = lambda pre, post: pre + post;
postfix = lambda post, pre: prefix(pre, post)

print(times2(10))
print(prefix("main", ".py"))
print(postfix(".py", "main"))

# ----------Output----------
20
main.py
main.py


#LambdaFunctions #PythonProgramming #PythonTips #GettingToKnowPython
❀1
...continued

To access attributes or call methods on an object we use a dot-notation., the variable followed by dot and the attribute or the method name.

Syntax: the dot-notation
# Accessing an attribute
object.attribute

# Calling a method
object.method()


Example: simplified computer object
class Computer:
# __init__ is a special method (a constructor)
def __init__(self, brand, model):
# attributes
self.brand = brand
self.model = model

# methods
def powerOn(self):
print(f"Powering on {self.brand} {self.model}")

def powerOff(self):
print(f"Powering off {self.brand} {self.model}")

c1 = Computer("HP", "OMEN")
c2 = Computer("Dell", "XPS")

# Test code
print(c2.brand + " " + c2.model)
c1.powerOn()


# Output
Dell XPS
Powering on HP OMEN


#oop #PythonProgramming #DotNotation
❀1