Learn Python Coding
39.9K subscribers
674 photos
34 videos
24 files
464 links
Learn Python through simple, practical examples and real coding ideas. Clear explanations, useful snippets, and hands-on learning for anyone starting or improving their programming skills.

Admin: @HusseinSheikho || @Hussein_Sheikho
Download Telegram
Python allows you to create enumerations that are also regular strings!

Previously, when working with APIs, JSON, and configurations, it was often necessary to manually extract the value from an Enum.

For example:
class Status(Enum):
ACTIVE = "active"

When serializing, you would get an enumeration object:
Status.ACTIVE

rather than a regular string:
"active"

In Python 3.11, StrEnum was introduced to solve this problem.
from enum import StrEnum

class Status(StrEnum):
ACTIVE = "active"
BLOCKED = "blocked"

Now, the value can be used wherever a string is expected:
json.dumps({"status": Status.ACTIVE})

The result:
{"status": "active"}

At the same time, the advantages of enumerations are preserved:
Status.ACTIVE
Status.BLOCKED

You cannot accidentally pass an incorrect value:
Status("unknown")

will result in an error.

🔥 StrEnum allows you to combine the strict typing of enumerations with the convenience of regular strings, without manual conversion when working with APIs, JSON, and configurations.

#Python #Coding #StrEnum #DevTips #Programming #Python311

Join Best TG Channels https://t.me/addlist/0f6vfFbEMdAwODBk

⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
3
Your AI assistant is guessing because it doesn't know your documents.

Build a private AI workflow over your own PDFs and documentation:

• choose a model that fits your RAM or VRAM
• index your files locally
• require answers with source citations
• test the workflow in Python before adding agents

How AI Helps publishes practical local-AI setups, failure cases and a free model picker — tested workflows, not recycled AI news.

👉 Join How AI Helps
1
Please open Telegram to view this post
VIEW IN TELEGRAM
2👍1
This channels is for Programmers, Coders, Software Engineers.

0️⃣ Python
1️⃣ Data Science
2️⃣ Machine Learning
3️⃣ Data Visualization
4️⃣ Artificial Intelligence
5️⃣ Data Analysis
6️⃣ Statistics
7️⃣ Deep Learning
8️⃣ programming Languages

https://t.me/addlist/8_rRW2scgfRhOTc0

https://t.me/Codeprogrammer
Please open Telegram to view this post
VIEW IN TELEGRAM
1
Please open Telegram to view this post
VIEW IN TELEGRAM
3
Please open Telegram to view this post
VIEW IN TELEGRAM
3
Please open Telegram to view this post
VIEW IN TELEGRAM
4
Please open Telegram to view this post
VIEW IN TELEGRAM
2