x = 43; x += 1; print(f"Tuesday Tip #{x}")


Hi Reader, happy Tuesday!

My recent tips have been rather lengthy, so I'm going to mix it up with some shorter tips (like today's). Let me know what you think! πŸ’¬


πŸ”— Link of the week

​A stealth attack came close to compromising the world's computers (The Economist)

If you haven't heard about the recent "xz Utils backdoor", it's an absolutely fascinating/terrifying story! In short, a hacker (or team of hackers) spent years gaining the trust of an open-source project by making helpful contributions, which eventually allowed them to smuggle a sophisticated, hidden exploit into the code.

Had a single developer at Microsoft not discovered the problem (in his spare time!), hackers would soon have gained secret access to hundreds of millions of computers, allowing them to steal private data from banks, governments, and more.

For more technical details, see this article from Ars Technica.


πŸ‘‰ Tip #44: Augmented assignment in Python

If you're new to Python (or programming in general), you might be confused by code like this:

x += 1

As long as x is a number, that code translates to:

x = x + 1

In other words, it's a concise way to increment the value of x by 1.

This is known as "augmented assignment," and there are actually a dozen other augmented assignment operators in Python. Here are the most common ones:

x -= 3 (translates to x = x - 3)

x *= 4 (translates to x = x * 4)

x /= 2 (translates to x = x / 2)

Under the hood, these statements call dunder methods such as __iadd__, __isub__, and so on, which means that their behaviors can be customized for different types of objects.

In case you're curious, the "i" in __iadd__ stands for "in-place" because it mutates the original object. As such, you may notice an unexpected behavior if you try to use these operations with Python lists.


πŸ‘‹ See you next Tuesday!

Did you like this week’s tip? Please forward it to a friend or share this link with your favorite online community. It really helps me out!

- Kevin

P.S. xkcd comes true (a reference to the link of the week)

Did someone AWESOME forward you this email? Sign up here to receive Data Science tips every week!

Learn Artificial Intelligence from Data School πŸ€–

Join 25,000+ intelligent readers and receive AI tips every Tuesday!

Read more from Learn Artificial Intelligence from Data School πŸ€–

Hi Reader, This week, I've got a short tip about AI agents, followed by some Data School news... πŸ‘‰ Tip #56: What are AI agents? Google is calling 2025 "the agentic era," DeepLearning.AI says "the agentic era is upon us," and NVIDIA's founder says "one of the most important things happening in the world of enterprise is agentic AI." Clearly AI agents are a big deal, but what exactly are they? Simply put, an AI agent is an application that uses a Large Language Model (LLM) to control its...

Hi Reader, Last week, I launched a brand new course: Build an AI chatbot with Python. 120+ people enrolled, and a few have already completed the course! πŸ‘ Want to join us for $9? πŸ‘‰ Tip #55: Should you still learn to code in 2025? You’ve probably heard that Large Language Models (LLMs) are excellent at writing code: They are competitive with the best human coders. They can create a full web application from a single prompt. LLM-powered tools like Cursor and Copilot can autocomplete or even...

Hi Reader, The Python 14-Day Challenge starts tomorrow! Hope to see you there 🀞 πŸ‘‰ Tuesday Tip: My top 5 sources for keeping up with AI I'll state the obvious: AI is moving incredibly FAST πŸ’¨ Here are the best sources I follow to keep up with the most important developments in Artificial Intelligence: The Neuron (daily newsletter) My top recommendation for a general audience. It’s fun, informative, and well-written. It includes links to the latest AI news and tools, but the real goldmine is...