es
Feedback
Python Learning

Python Learning

Ir al canal en Telegram

Python learning resources Beginner to advanced Python guides, cheatsheets, books and projects. For data science, backend and automation. Join 👉 https://rebrand.ly/bigdatachannels DMCA: @disclosure_bds Contact: @mldatascientist

Mostrar más
5 849
Suscriptores
+224 horas
+67 días
-330 días
Archivo de publicaciones
Collection Data Types in Python
Collection Data Types in Python

Selection Sort Using Python
Selection Sort Using Python

What will be Printed?
Anonymous voting

photo content

photo content

photo content

Python Handwritten Notes.pdf22.53 MB

Given the above Python code, what will be printed?
Anonymous voting

photo content

Python for Absolute Beginners.pdf7.68 MB

Looks neat, right? But let’s slow down. The *b syntax is called extended iterable unpacking. It grabs everything in the middl
Looks neat, right? But let’s slow down. The *b syntax is called extended iterable unpacking. It grabs everything in the middle of the list, leaving the first item (a) and the last (c) outside the star. This pattern is super handy, but can also behave unexpectedly if you assume it’ll grab just one item or not consider the structure of the data. The starred variable always gets a list, and it can be empty so plan accordingly when unpacking, especially in function arguments or loops. For example: Consider the following code
x, *y = [42]
print(y)  # []
No error, but y is just an empty list! Unpacking doesn’t always fill every name the way you might guess.

Enjoy our content? Advertise on this channel and reach a highly engaged audience! 👉🏻 It's easy with Telega.io. As the leadi
Enjoy our content? Advertise on this channel and reach a highly engaged audience! 👉🏻 It's easy with Telega.io. As the leading platform for native ads and integrations on Telegram, it provides user-friendly and efficient tools for quick and automated ad launches. ⚡️ Place your ad here in three simple steps: 1 Sign up 2 Top up the balance in a convenient way 3 Create your advertising post If your ad aligns with our content, we’ll gladly publish it. Start your promotion journey now!

What is an F-String in Python?
What is an F-String in Python?

#PyQuiz What does range(5)[-1] return?
Anonymous voting

Feels off? It's because all your objects share one variable (without you realizing it) At first glance, it seems like every o
Feels off? It's because all your objects share one variable (without you realizing it) At first glance, it seems like every object should start fresh, right? But in this case, count is a class variable, which means it’s shared by all instances of the class. Every time you create a new Counter(), you’re actually incrementing the same shared variable not something unique to each object. If your goal is to give each object its own value, define it like this instead
class Counter:
    def __init__(self):
        self.count = 1
Now, each instance has its own count, stored on the object itself . no sharing, no surprises.

#PyQuiz Which of these is NOT a valid Python data type?
Anonymous voting

Why did x change too?! Because x and y are just two names pointing to the same list in memory. When you modify one, the chang
Why did x change too?! Because x and y are just two names pointing to the same list in memory. When you modify one, the change reflects in both. Use .copy() or slicing [:] if you want a separate list: y = x.copy() That way, you’re not changing the original but just making your own version.

#PyQuiz Which is faster: list() or [ ]?
Anonymous voting

Difference Between Variable and Object in Python
Difference Between Variable and Object in Python

#PyQuiz What's the result of len(set("hello"))?
Anonymous voting