7 Sources of Passive Income for Coders
These are the types of passive income: Affiliate earnings Advertising earnings eBooks Online courses SaaS Index funds and exchange-traded funds (ETFs) Real estate
These are the types of passive income: Affiliate earnings Advertising earnings eBooks Online courses SaaS Index funds and exchange-traded funds (ETFs) Real estate
Problem: How to return from a Python function or method in single line? Example: Consider the following “goal” statement: However, this leads to a Syntax error: In this tutorial, you’ll learn how to write the return statement with an if expression in a single line of Python code. You can get an overview of the … Read more
Python freelancers earn $51 per hour on average. But how do they do it? In the following video I show you the top five trending gigs for Python freelancers: In summary, these are the most trending jobs how Python freelancers earn money in 2020: Create educational content:. You can write blog articles for blog owners, … Read more
This article will be fun! You’ll learn about an important concept in security: reverse shells. You’ll also learn how to create reverse shells in Python in a single line of code. So, let’s start with the big question: What is a Reverse Shell? Here’s the definition of a Reverse Shell: A reverse shell is used … Read more
PEP 8 purists are ready to attack you and your code if they catch you not complying with the PEP 8 standard. For instance, Python coders put their braces, brackets, or parentheses into a separate line to make it easier to grasp nested lists or dictionaries. This article shows how to line up the closing … Read more
Summary: To make a Python one-liner out of any multi-line Python script, replace the new lines with a new line character ‘\n’ and pass the result into the exec(…) function. You can run this script from the outside (command line, shell, terminal) by using the command python -c “exec(…)”. Problem: Given a multi-line code script … Read more
Summary: You can accomplish one line exception handling with the exec() workaround by passing the one-linerized try/except block as a string into the function like this: exec(‘try:print(x)\nexcept:print(“Exception!”)’). This general method works for all custom, even multi-line, try and except blocks. However, you should avoid this one-liner code due to the bad readability. Surprisingly, there has … Read more
The following three ideas can lead to passive income using Upwork or Fiverr: Hire experts in their niches on Upwork or Fiverr to create online courses and sell them on Udemy Hire experts in their niches on Upwork or Fiverr to create ebooks and sell them on Amazon Hire freelance developers on Upwork or Fiverr … Read more
The with statement replaces former try…finally blocks in Python. It ensures that clean-up code is executed. For example, it closes open files before leaving the block. Consider this code example (assuming this code is stored in a file named ‘code.py’): The output of this code would be the code itself (for nerds: a piece of … Read more
Most computer scientists, programmers, and hackers don’t even know the meaning of the word “Quine” in the context of programming. So, first things first: What is a Quine? Roughly speaking, a quine is a self-reproducing program: if you run it, it generates itself. Here’s a great definition: :quine: /kwi:n/ /n./ [from the name of the … Read more
When reading over other people’s Python code, many beginners are puzzled by the __init__(self) method. Whatβs its purpose? This article answers this question once and for all. What’s the purpose of __init__(self) in Python? The reserved Python method __init__() is called the constructor of a class. You can call the constructor method to create an … Read more
$56/hour How much can you expect to earn as a Python freelancer? The average Python developer worldwide earns $56 per hour (fluctuations between $51 and $61). This statistic is based on five credible online sources including the US government. In the US, the average Python developer earns $60 per hour or more. Based on a conservative … Read more