Learn Python Coding
40.6K subscribers
706 photos
36 videos
24 files
508 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
Cheat sheet on Python Data Types 🐍

Python Data Types β€” the main data types in Python.

πŸ”’ Numbers β€” numerical types (int, float, complex)
βš–οΈ Bool β€” logical values (True, False)
πŸ“ String β€” text strings
πŸ“‹ List β€” mutable ordered collections
πŸ”’ Tuple β€” immutable ordered collections
🎲 Set β€” unique unordered elements
πŸ—‚οΈ Dict β€” collections of "key-value" pairs.

Helps to quickly orient yourself in data types and choose the appropriate structure for storing information πŸ’‘

#Python #DataScience #Coding #Programming #Tech #Learning

✨ Join Best TG Channels https://xn--r1a.website/addlist/0f6vfFbEMdAwODBk

⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A

πŸš€ Level up your AI & Data Science skills with HelloEncyclo β€” a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
βœ… 13 courses live + 40+ coming soon
🎯 One access, lifetime updates
πŸ”‘ Use code: PRESALE-BOOK-WAVE-2GFG
πŸ‘‰ https://helloencyclo.com/?ref=HUSSEINSHEIKHO0
❀2
Variables in Python are stickers, not boxes.

A variable doesn't store a value, but points to it. If you change a list, both variables will see the change. This makes sense with stickers. But with boxes, it's magic: two boxes mysteriously change simultaneously.

✨ Join Best TG Channels https://xn--r1a.website/addlist/0f6vfFbEMdAwODBk

⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A

πŸš€ Level up your AI & Data Science skills with HelloEncyclo β€” a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
βœ… 13 courses live + 40+ coming soon
🎯 One access, lifetime updates
πŸ”‘ Use code: PRESALE-BOOK-WAVE-2GFG
πŸ‘‰ https://helloencyclo.com/?ref=HUSSEINSHEIKHO

#Python #Programming #Variables #Coding #Tech #DataScience
❀4
3 quick ways to merge dictionaries in Python 🐍

1️⃣ The operator | (Python 3.9+) β€” the most modern and elegant way. Creates a new dictionary.

dict1 = {'a': 1, 'b': 2}
dict2 = {'b': 99, 'c': 4}

combined = dict1 | dict2
# Result: {'a': 1, 'b': 99, 'c': 4} (values of the second dictionary replace the first)

2️⃣ The in-place update operator |= (Python 3.9+) β€” if you need to modify the first dictionary in place.

dict1 |= dict2

#Python #Coding #DevOps #Programming #Tech #DataScience

✨ Join Best TG Channels https://xn--r1a.website/addlist/0f6vfFbEMdAwODBk

⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
❀4
Forwarded from Udemy Free
250+ Python DSA Coding Practice Test [Questions & Answers]

Python DSA Coding Interview Questions and Answers (Solution Code with Detailed Explanations) | Coding Practice Exercises…

🏷 Category: development
🌍 Language: English (US)
πŸ‘₯ Students: 110 students
⭐️ Rating: 0.0/5.0 (0 reviews)
πŸƒβ€β™‚οΈ Enrollments Left: 5
⏳ Expires In: 0D:30H:30M
πŸ’° Price: $23.03 ⟹ FREE
πŸ†” Coupon: 731B3C9353AE09ABE19E

⚠️ Watch 2 short ads to unlock your free access.

πŸ’Ž By: https://xn--r1a.website/Udemy26
#Programming #Coding #Development #Tech #Python #DataScience
**Today we will examine __call__ β€” a data filter object!** 🧠

It allows a class instance to work as a function, preserving the state and filtering rules. βš™οΈ

Let's create a filter for numbers that only passes even ones and strictly greater than a specified threshold:

class EvenFilter:
def __init__(self, threshold):
self.threshold = threshold

def __call__(self, numbers):
return [n for n in numbers if n % 2 == 0 and n > self.threshold]

Let's use the filter in practice:

f = EvenFilter(5)
nums = [1, 4, 6, 7, 10]
print(f(nums)) # [6, 10]

Now each instance can have its own rules:

f2 = EvenFilter(8)
print(f2(nums)) # [10]

πŸ”₯ So, __call__ turns an object into a "smart function" with memory and customizable logic. πŸ’‘

#Python #DataScience #Programming #Coding #Tech #HelloEncyclo

✨ Join Best TG Channels https://xn--r1a.website/addlist/0f6vfFbEMdAwODBk

⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A

πŸš€ Level up your AI & Data Science skills with HelloEncyclo β€” a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
βœ… 13 courses live + 40+ coming soon
🎯 One access, lifetime updates
πŸ”‘ Use code: PRESALE-BOOK-WAVE-2GFG
πŸ‘‰ https://helloencyclo.com/?ref=HUSSEINSHEIKHO
❀4
collections.Counter β€” counting elements in a single line. πŸ“Š

Counting elements without loops with Counter πŸ”„

Do you need to count how many times each word appears in a text or how many duplicates there are in a list? Don't reinvent the wheel with for loops and dictionaries. The built-in collections module will do everything for you. πŸš€

πŸ›  Code:
from collections import Counter

words = ["apple", "banana", "apple", "cherry", "banana", "apple"]
word_counts = Counter(words)

print(word_counts)
# Output: Counter({'apple': 3, 'banana': 2, 'cherry': 1})

# Bonus: the top 2 most frequent elements
print(word_counts.most_common(2))
# Output: [('apple', 3), ('banana', 2)]

Ideal for basic data analysis and solving tasks on LeetCode. πŸ’»

✨ Join Best TG Channels https://xn--r1a.website/addlist/0f6vfFbEMdAwODBk

⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A

πŸš€ Level up your AI & Data Science skills with HelloEncyclo β€” a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
βœ… 13 courses live + 40+ coming soon
🎯 One access, lifetime updates
πŸ”‘ Use code: PRESALE-BOOK-WAVE-2GFG
πŸ‘‰ https://helloencyclo.com/?ref=HUSSEINSHEIKHO

#Python #DataScience #Coding #Programming #LearnToCode #TechSkills
❀6
✨ Unpacking the remaining elements 🧩

Sometimes you need to extract the first and last elements from a list, while grouping everything in the middle separately. Instead of struggling with slicing ([1:-1]), use the asterisk (*). ⭐️

data = ["CEO", "Middle Python Dev", "Junior Dev", "QA", "HR"]

# The asterisk automatically collects everything "extra" into a separate list.
boss, *team, hr = data

print(boss) # CEO
print(team) # ['Middle Python Dev', 'Junior Dev', 'QA']
print(hr) # HR

#Python #Coding #DataScience #DevLife #Programming #Tech

✨ Join Best TG Channels https://xn--r1a.website/addlist/0f6vfFbEMdAwODBk

⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
❀2πŸ”₯1
Forwarded from Udemy Free
Python Practice Tests: 210+ Questions Basics to Advanced

210+ Python questions: fundamentals, OOP, libraries & advanced concepts. Ace your interview & certification prep.…

🏷 Category: development
🌍 Language: English (US)
πŸ‘₯ Students: 6,036 students
⭐️ Rating: 4.5/5.0 (25 reviews)
πŸƒβ€β™‚οΈ Enrollments Left: 65
⏳ Expires In: 0D:30H:30M
πŸ’° Price: $9.59 ⟹ FREE
πŸ†” Coupon: MGM3Y2D100

⚠️ Watch 2 short ads to unlock your free access.

πŸ’Ž By: https://xn--r1a.website/Udemy26
#Programming #Coding #Development #Tech #Python #DataScience
❀3
Forwarded from Udemy Free
πŸ”” Still Available!

Python Complete Course And Flask Framework, HTML Essentials

Python Complete Course For Python Beginners.Learn Python and Flask Framework and HTML From Beginner To Advanced Level…

🌍 Language: English (US)
πŸ‘₯ Students: 59,595 students
⭐️ Rating: 4.5/5.0 (897 reviews)
πŸƒβ€β™‚οΈ Enrollments Left: 42
⏳ Expires In: 0D:30H:30M
πŸ’° Price: $25.31 ⟹ FREE
πŸ†” Coupon: 3E55EA920FA0654463D2

⚑ Opens instantly β€” your free link unlocks on its own in seconds, no ad required.

πŸ’Ž By: https://xn--r1a.website/Udemy26
#Python #DataScience #Automation #FreeCourse #Udemy #OnlineLearning
Forwarded from Udemy Free
πŸŽ“ New Free Course Alert!

400 Python Vaex Interview Questions with Answers 2026

Python Vaex Interview Questions Practice Test | Freshers to Experienced | Detailed Explanations for Each Question…

πŸ“ Category: N/A
πŸ—£ Language: English
πŸ‘¨β€πŸŽ“ Enrolled: 200 students
⭐ Rating: 0/5.0
πŸ’΅ Price: $34.99 ➜ FREE (100% OFF)
🎟 Coupon: FD274EC04242F4560D04

⚑ Your free link unlocks automatically in a few seconds β€” no ad required.

πŸ’Ž By: https://xn--r1a.website/Udemy26
#Python #DataScience #Automation #FreeCourse #Udemy #OnlineLearning
❀2
Forwarded from Udemy Free
πŸŽ“ New Free Course Alert!

Data Structures & Algorithms (Python): Practice Exams

Ace technical coding interviews with 200 questions on Big O, Graphs, Hash Maps, and Dynamic Programming.…

πŸ“ Category: Development / Software Engineering
🎯 Level: Intermediate Level
πŸ—£ Language: English
πŸ‘¨β€πŸŽ“ Enrolled: 317 students
⭐ Rating: 0/5.0
πŸ’΅ Price: $49.99 ➜ FREE (100% OFF)
🎟 Coupon: BC7C61AF20F4AE188D90

⚑ Your free link unlocks automatically in a few seconds β€” no ad required.

πŸ’Ž By: https://xn--r1a.website/Udemy26
#Programming #Coding #Development #Tech #Python #DataScience
❀2
Using pickletools.dis() to analyze serialized data.

🐍 pickle doesn't just store a snapshot of an object; it stores a sequence of instructions for its subsequent reconstruction.

Normally, we only see the result of serialization:

import pickle

payload = pickle.dumps(
{"name": "Alex", "roles": ["admin", "user"]}
)

print(len(payload))


The standard library includes pickletools.dis(), which disassembles the pickle stream and shows its instructions in a readable format.

import pickletools

pickletools.dis(payload)


The output shows the creation of a dictionary, strings, a list, and the operations used to assemble the final object.

EMPTY_DICT
SHORT_BINUNICODE 'name'
SHORT_BINUNICODE 'Alex'
SHORT_BINUNICODE 'roles'
EMPTY_LIST


This is useful when debugging your own classes: you can check which global objects and reconstruction mechanisms are included in the serialization.

class User:
def init(self, name):
self.name = name

payload = pickle.dumps(User("Alex"))

pickletools.dis(payload)

For further analysis, there's pickletools.optimize(): it removes some unused operations from the pickle stream without changing the object being reconstructed.

optimized = pickletools.optimize(payload)

assert pickle.loads(optimized).name == "Alex"


⚠️ pickletools is designed for analyzing pickle streams, not for safely reading untrusted data. You should still not pass unknown pickle data to pickle.loads().

πŸ”₯ pickletools.dis() allows you to peek inside the serialization and see the instructions from which pickle reconstructs the object.

#Python #Pickle #DataScience #Debugging #Coding #DevTools

✨ Join Best TG Channels https://xn--r1a.website/addlist/0f6vfFbEMdAwODBk

⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
❀2