Python oct() Function

Python’s built-in oct(integer) function takes one integer argument and returns an octal string with prefix “0o”. If you call oct(x) on a non-integer x, it must define the __index__() method that returns an integer associated to x. Otherwise, it’ll throw a TypeError: object cannot be interpreted as an integer. Argument integer An integer value or … Read more

Less Is More in Design

This chapter draft from my upcoming book “From One to Zero: Minimalism in Programming” will appear in revised form in 2021 with NoStarch (SanFrancisco). Stay tuned for updates on the book launch: In this chapter, you’ll enter a vital area in computer science that greatly benefits from a minimalistic mindset: design and user experience (UX). … Read more

How to Convert a Unicode String to a String Object in Python?

This tutorial will show you how to convert a Unicode string to a string in Python. If you already know about Unicode, you can skip the following background section and dive into the problem right away. Background Unicode A bit about Unicode from Wikipedia. Unicode is a character encoding standard that includes characters from almost … Read more

Top 10 Algorithm Cheat Sheets

Hey Finxters! Do you  know what time it is? That’s right! It’s time for some more cheat sheets!! These cheat sheets are meant to help you on your way to becoming a great Python developer and of course becoming one of the best Python freelancers globally! This article is all about algorithms used in software … Read more

How to Create an Interactive Web Application using a Jupyter Notebook

Summary: To create an interactive web application in a Jupyter Notebook, use the three libraries ipywidgets, voila, and binder. This requires only basic Python programming skills without the need to learn a new framework. There are various Python tools available to create web applications and frontend GUIs. For example, Flask and Django. As useful as … Read more

Python property() — What You Always Wanted to Know But Never Dared to Ask

Object-orientation is great way to encapsulate data in your application. This minimizes complexity and adheres to good software engineering principles. However, attributes in Python can be easily accessed from the outside—they’re not really encapsulated. That’s one of the reason the property() built-in function exists: it allows you to truly encapsulate data with the means of … Read more

Python id() Function

Python’s built-in id(object) function takes a Python object as an input and returns the identity of an object that is a static, unique integer. The identity is static, it never changes throughout the program’s execution, and unique, no other object has the same identity. It is implemented in cPython by returning the address of the … Read more

Python type() Function

Python’s built-in type() function has two purposes. First, you can pass an object as an argument to check the type of this object. Second, you can pass three arguments—name, bases, and dict—to create a new type object that can be used to create instances of this new type. Usage Learn by example! Here’s an example … Read more

A Recursive Pathfinder Algorithm in Python

A simple and effective way to grow your computer science skills is to master the basics. Knowing the basics sets apart the great coders from the merely intermediate ones. One such basic area in computer science is graph theory, a specific subproblem of which—the pathfinder algorithm—we’ll address in this tutorial. So first things first: What … Read more

Top 10 Python OpenCV Cheat Sheets

Hey Finxters! It is time for another Python Cheat Sheet! As a brief introduction, OpenCV is an open-source computer vision and machine learning software library of programming functions mainly aimed at real-time computer vision. In this article, I am bringing you the best 10 Python cheat sheets on OpenCV. Let me introduce Python OpenCV to … Read more