How to Multiply Matrices in Python

In Python and most other OOP programming languages, multiplying two numbers by each other is a pretty straightforward process. Where it gets a little more complicated, however, is when you try to multiply two matrices by each other. A matrix, as you may know, is basically just a nested list, or a number of lists […]

Read More

How to Check for Object Type in Python

This beginner’s Python tutorial will teach you the basics of how to check for an object type in Python. As you probably already know, different types of objects in Python. Objects can be lists, strings, integers, etc. There may be times in your career as a developer where you need to know the difference between one […]

Read More

Build Games for Python Using Pygame

Pygame is a set of modules designed to help you write Python games by providing you with extra functionalities and libraries. It’s free, supports Python 3.2 and up, runs on just about every operating system and platforms, and has over a million downloads, so it’s very widely used. Pygame is super speedy because it uses optimized […]

Read More

Using Python to Display Calendars

Here’s a fun thing about Python that you may or may not already be familiar with: it has a built-in calendar function you can use to display as many calendars as you like. When you import the function, you can use it to display a month of any year in standard calendar format (a month at […]

Read More

Using Modulo to Check for Leap Year in Python

We’ve already covered the modulo (%) operator in a previous lesson, but just as a quick refresher, the modulo is an operator that is used to calculate the remainder of one number divided by another. So if you have an equation such as 6 % 3, the answer would be 0, because 3 goes into […]

Read More

Python Code Snippets: Solving the Quadratic Equation

Here’s a fun way to use Python: input any three numbers into a function and you can solve the quadratic equation in milliseconds. Bet you wish you knew about this one back when you were in Algebra I class. The function, written by the people over at Programiz, solves the quadratic equation using basic multiplication […]

Read More

Top 5 Free Python Resources for Beginners

Learning Python as a beginner can be a little overwhelming. Where do you start? How do you know you’re getting the best possible information? What do you do once you’ve gotten down the basics? If you’ve recently found yourself asking any of these questions, you’ve come to the right place. In this post, we’ve compiled a […]

Read More

Using Exponents in Python

By now, you probably know how to multiply and divide numbers in Python. Multiplication in Python is fairly simple and easy to do. But what about using exponents? How would you raise a number to the second power, for example? If you’re not sure, you’ll probably find the answer pretty straightforward. To raise a number […]

Read More

Multiplying and Dividing Numbers in Python

Multiplication is a fundamental operation in the arithmetic and programming world. We can find its use in every program(or in the logic behind every code), no matter how basic it is. Thus a programmer must know how to multiply integers, decimals, complex numbers, and strings in Python to create an efficient and accurate code. In […]

Read More

Using Python to Find the Largest Number out of Three

Here’s a useful snippet that will show you how to use Python to find the largest number out of any three given numbers. Basically, the snippet works by using the if…elif…else statements to compare the three numbers against each other and determine which one is the largest. Check out the snippet below to see how […]

Read More