Posts

Showing posts from March, 2023

Featured Post

How To Use Python Arithmetic Operators

Image
How To Use Python Arithmetic Operators Introduction Arithmetic Operators are used in Python to carry out mathematical operations on numerical values. It is very important to understand this operator well in order to complete Python projects that require you to do carry out mathematical calculations. In this guide, you will come across all the different types of arithmetic operators that will be explained in an easy-to-understanad manner. Types of Python Arithmetic Operators There are six types of arithmetic operators in Python and in this guide, I will be explaining every one of them with detailed explanation as well as with simple example exercises, for your easy understanding! So, keep reading this post until the very end , so that you do not miss out any valid points. The 6 types of arithmetic operators are :  1. Addition Operator  2. Subtraction Operator   3. Multiplication Operator  4. Division Operator 5. Modulus Operator  6. Exponential Operator Addi...

A Simple Guide to Sets in Python

Image
A Simple Guide To Sets in Python Photo Credit : Photo by Markus Spiske from Pexels I NTRODUCTION Sets store multiple data collections in a single variable and the items have no particular order or index and they are also not mutable either, which is why, their items can appear in any order when we perform operations on them, since they are not indexed, so , we can not refer to them by their index position. A Set is represented by a pair of curly braces. A set does not permit duplicate items. HOW TO CREATE A SET  Below, in the code, you can understand, how a set is created. The variable myset is a set containing multiple items, that are string items , namely, 'cat', 'dog' and 'rabbit'. We use the curly braces to enclose the three items as shown below and you can use the print function to get the resultant set containing these items. mytuple = {cat","dog","rabbit"} print(myset)   ...

A Simple Guide to Python Tuples

Image
A Simple Guide To Python Tuples     picture credit : Person Holding an Orange and Blue Python Sticker by RealToughCandy What Are Tuples Tuples allow storage of multiple items using a single variable. Tuples are frequently used in Python for storing data and every programmer needs to know all about tuples in order to code efficiently in Python. Definition of Tuples Tuples could be considered as a collection containing multiple data items that are unchangeable and ordered and also  enclosed in round brackets.  Tuples are infact inbuilt data structures that store different types of data in one variable. Tuples use round parentheses to store data. How to create a Tuple Below, in the code, you can understand, how a tuple is created. The variable mytuple is a tuple containing multiple items, that are string items , namely, 'cat', 'dog' and 'rabbit'. We use the round brackets to enclose the three items as shown below and you can use the print function to get the result...