✨ Python 3.14: Cool New Features for You to Try ✨
📖 Learn what's new in Python 3.14, including an upgraded REPL, template strings, lazy annotations, and subinterpreters, with examples to try in your code.
🏷️ #intermediate #python
📖 Learn what's new in Python 3.14, including an upgraded REPL, template strings, lazy annotations, and subinterpreters, with examples to try in your code.
🏷️ #intermediate #python
❤4
Python.pdf
488 KB
👨🏻💻 An excellent note that teaches everything from basic concepts to building professional projects with Python.
➖➖➖➖➖➖➖➖➖➖➖➖➖
Please open Telegram to view this post
VIEW IN TELEGRAM
❤2
✨ Quiz: Python 3.14: Cool New Features for You to Try ✨
📖 In this quiz, you'll test your understanding of the new features introduced in Python 3.14. By working through this quiz, you'll review the key updates and improvements in this version of Python.
🏷️ #intermediate #python
📖 In this quiz, you'll test your understanding of the new features introduced in Python 3.14. By working through this quiz, you'll review the key updates and improvements in this version of Python.
🏷️ #intermediate #python
Clean code advice in Python:
Use Enum to logically group related constants.
Use Enum to logically group related constants.
from dataclasses import dataclass
from enum import Enum
Bad:
ORDER_PLACED = "PLACED"
ORDER_CANCELED = "CANCELED"
ORDER_FULFILLED = "FULFILLED"
@dataclass
class Order:
status: str
order = Order(ORDER_PLACED)
print(order)
Good:
class OrderStatus(str, Enum):
PLACED = "PLACED"
CANCELED = "CANCELED"
FULFILLED = "FULFILLED"
@dataclass
class Order:
status: OrderStatus
order = Order(OrderStatus.PLACED)
print(order)
❤6
Clean code tip for Python:
Use a dictionary to remove duplicates from a list while preserving the order of elements.
The point is that dictionary keys are unique, and starting from Python 3.7, the order of insertion is preserved.
So this is a concise way to remove duplicates without losing order.
👉 @DataScience4
Use a dictionary to remove duplicates from a list while preserving the order of elements.
names = ["John", "Daisy", "Bob", "Lilly", "Bob", "Daisy"]
unique_names = list({name: name for name in names}.values())
print(unique_names)
# ['John', 'Daisy', 'Bob', 'Lilly']
The point is that dictionary keys are unique, and starting from Python 3.7, the order of insertion is preserved.
So this is a concise way to remove duplicates without losing order.
Please open Telegram to view this post
VIEW IN TELEGRAM
❤3👍1🔥1
✨ large language model (LLM) | AI Coding Glossary ✨
📖 A neural network that predicts the next token to perform general-purpose language tasks.
🏷️ #Python
📖 A neural network that predicts the next token to perform general-purpose language tasks.
🏷️ #Python
✨ generative pre-trained transformer (GPT) | AI Coding Glossary ✨
📖 Autoregressive language models that use the transformer architecture and are pre-trained on large text corpora.
🏷️ #Python
📖 Autoregressive language models that use the transformer architecture and are pre-trained on large text corpora.
🏷️ #Python
✨ Reference: AI Coding Glossary ✨
📖 Concise explanations of foundational terms and concepts for AI-assisted coding.
🏷️ #2_terms
📖 Concise explanations of foundational terms and concepts for AI-assisted coding.
🏷️ #2_terms
❤2
✨ model context protocol (MCP) | AI Coding Glossary ✨
📖 An open, client-server communication standard that lets AI applications connect to external tools and data sources.
🏷️ #Python
📖 An open, client-server communication standard that lets AI applications connect to external tools and data sources.
🏷️ #Python
✨ agent | AI Coding Glossary ✨
📖 A system that perceives, decides, and acts toward goals, often looping over steps with tools, memory, and feedback.
🏷️ #Python
📖 A system that perceives, decides, and acts toward goals, often looping over steps with tools, memory, and feedback.
🏷️ #Python
Forwarded from PyData Careers
Question: What are the differences between
eqe
For instance:
Here,
By: @DataScienceQ🚀
__eq__ and __ne__ methods in Python?eqe
__eq__ and __ne__ methods are special methods used to define the behavior of the equality and inequality operators (== and !=, reseq. The __eq__ method returns True if two objects are consideredneereas __ne__ returns True if they are considereeql. If __eq__ is defined, it's common practiceneefine __ne__ to maintain consistent logic. For instance:
class MyClass:
def __eq__(self, other):
return True
def __ne__(self, other):
return False
Here,
MyClass would always return True for equality and False for inequality.By: @DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
✨ artificial intelligence (AI) | AI Coding Glossary ✨
📖 The field of building machines and software that perform tasks requiring human-like intelligence.
🏷️ #Python
📖 The field of building machines and software that perform tasks requiring human-like intelligence.
🏷️ #Python
✨ agentic coding | AI Coding Glossary ✨
📖 An approach to software development in which AI agents plan, write, run, and iteratively improve code.
🏷️ #Python
📖 An approach to software development in which AI agents plan, write, run, and iteratively improve code.
🏷️ #Python
Please open Telegram to view this post
VIEW IN TELEGRAM
❤2
✨ vibe coding | AI Coding Glossary ✨
📖 An AI-assisted programming style where a developer describes goals in natural language and accepts model-generated code with minimal manual editing.
🏷️ #Python
📖 An AI-assisted programming style where a developer describes goals in natural language and accepts model-generated code with minimal manual editing.
🏷️ #Python
❤1👎1
✨ prompt | AI Coding Glossary ✨
📖 The input text or a structured message that tells a generative model what to do.
🏷️ #Python
📖 The input text or a structured message that tells a generative model what to do.
🏷️ #Python
❤2
✨ transformer | AI Coding Glossary ✨
📖 A neural network model that uses self-attention to handle sequences without recurrence or convolutions.
🏷️ #Python
📖 A neural network model that uses self-attention to handle sequences without recurrence or convolutions.
🏷️ #Python
❤1