Python Reverse List with Slicing — An Illustrated Guide

Summary: The slice notation list[::-1] with default start and stop indices and negative step size -1 reverses a given list. Problem: Given a list of elements. How to reverse the order of the elements in the list. Example: Say, you’ve got the following list: Your goal is to reverse the elements to obtain the following … Read more

Python shutil: High-Level File Operations Demystified

Are you looking to copy, move, delete, or archive data with your Python programs? If so, you’re in the right place because this article is all about the module that’s been specially designed for the job. It’s called shutil (short for shell utilities) and we’ll be demystifying its key features by way a few simple … Read more

How to Remove Duplicates From a Python List While Preserving Order?

To remove duplicates from a Python list while preserving the order of the elements, use the code list(dict.fromkeys(list)) that goes through two phases: (1) Convert the list to a dict using the dict.fromkeys() function with the list elements as keys and None as dict values. (2) Convert the dictionary back to a list using the … Read more

Freelance Developer Without Experience

Can you become a highly successful freelance developer working from the comfort of your home—without having any experience? Most freelance developers don’t have any experience when they get started on freelancing platforms such as Upwork or Fiverr. You can succeed by following the three simple steps: (1) get your first gig, (2) learn what’s needed, … Read more

How to Get the Last Element of a Python List?

Problem: Given a list. How to access the last element of this list? Example: You have the list [‘Alice’, ‘Bob’, ‘Liz’] and you want to get the last element ‘Liz’. Quick solution: Use negative indexing -1. To access the last element of a Python list, use the indexing notation list[-1] with negative index -1 which … Read more

List Changes After Assignment — How to Clone or Copy It?

Problem: If you assign a list object to a new variable using new_list = old_list, any modification to new_list changes old_list. What’s the reason for this and how can you clone or copy the list to prevent this problem? Example: Let’s consider the following example. Appending an element to the new_list also modifies the original … Read more

How To Format A String That Contains Curly Braces In Python?

Summary: Use one of the following methods to format strings that contain curly braces: Use double curly braces {{}} Use the old string formatting, i.e. the % operator Use the JSON Library Use Template Strings Problem: Given a string literal with curly braces; how to format the string and ensure that the curly braces are … Read more

Freelance Developing Niche

This short article is based on the ultimate guide to freelance developing on the Finxter blog. You’ll first learn about the definition of freelancing. Then, I’ll show you how you can evaluate whether the freelance developing niche is attractive for you and whether you can expect it to grow over time. So, let’s get started, … Read more

26 Freelance Developer Tips to Double, Triple, Even Quadruple Your Income

There’s a reason why programmers, software developers, and hackers never seem to go out of vogue: Leverage. A skilled programmer may spend a year writing software which, in turn, automates the jobs performed by thousands of workers. Soon will a program for automated driving destroy billions of today’s and tomorrow’s jobs in the logistics sector. … Read more