Renan Moura

Renan Moura

I'm a Software Engineer working in the industry for a decade now. I like to solve problems with as little code as possible. I’m interested in solving all sorts of problems with technology in creative and innovative ways. From everyday shell scripts to machine learning models. I write about Software Development, Machine Learning, and Career in tech.

Identity Operators in Python

how to python

These operators are used to check if two objects are at the same memory location. Notice that they do not compare values, but memory location. They are: is: returns True if both objects are identical is not: returns True if…

Comparison Operators in Python

how to python

Use comparison operators to compare two values. These operators return either True or False. They are: ==: Equal !=: Not equal >: Greater than <: Less than >=: Greater than or equal to <=: Less than or equal to Let’s…

Logical Operators in Python

how to python

Logical operators are used to combine statements applying boolean algebra as shown in this article Booleans in Python. They are: and: True only when both statements are true or: False only when both x and y are false not: The…

Assignment Operators in Python

how to python

As the name implies, these operators are used to assign values to variables. x = 7 in the first example is a direct assignment storing the number 7 in the variable x. The assignment operation takes the value on the…

Arithmetic Operators in Python

how to python

Arithmetic operators are the most common type of operators and also the most recognizable ones. They allow you to perform mathematical operations. They are: +: Addition -: Subtraction *: Multiplication /: Division **: Exponentiation //: Floor Division, rounds down the…

center(): centered string in Python

how to python

Use the center() method to center a string. word = 'beach' number_spaces = 32 word_centered = word.center(number_spaces) print(word) #'beach' print(word_centered) ##output: ' beach ' Notice the spaces in the second string. The word ‘beach’ has 5 characters, which gives us…

Bitwise Operators in Python

how to python

Bitwise Operators allow you to perform operations on binary numbers. The values are automatically converted to binary and then the logic is applied to them. The output is also converted back from binary implicitly. They are: &: AND Only the…

How to find the largest number in Python

how to python

In this post, we will learn how to find the largest number. The first program uses the if statement to achieve that. The second program, the recommended way, uses the built-in max function and a list. Code using the if…