Python: “0.1 + 0.2 ≠ 0.3”. Me: “?”

Python Representation Error: This article explains why floating-point arithmetic can lead you astray in Python. Floating-point arithmetic cannot represent some numbers precisely. While many people think it’s a bug, it’s actually not. Have a look at the following code snippet: In the code snippet, you have assumed that the number 0.1 actually represents the decimal … Read more

How to Embed a Python Interpreter in Your Website?

Want to make your website more interactive? Embed a Python interpreter into your website! This does not only increase the interactivity and usability of your website — and create happy users for your web business. It also increases the average time spent on your website because people will try out things. So it’s actually a … Read more

The Ultimate Guide to NumPy Reshape() in Python

Most of the function names in Python can be intuitively connected to the meaning of the function. The NumPy reshape() function is not an exception. The reshape() function brings an array into another shape while keeping all the original data. NumPy’s reshape() function takes an array to be reshaped as a first argument and the … Read more

What is Short Circuit Evaluation in Python?

Short circuit evaluation in any programming language is the act of not executing unnecessary parts of a Boolean expression. Say, you want to calculate the result of the expression “A and B” but you already know that “A=False”. Because of your knowledge of the first part of the expression, you already know that the result … Read more

How to Escape 9 to 5 as a Python Freelancer?

Why do YOU want to improve your coding skills? I vividly remember my first semester studying computer science more than 10 years ago. I knew almost nothing about coding. My uncle, a professional software developer, had quickly shown me the programming language “Visual Basic” and told me something which you may find helpful in your … Read more