Home » python

Tag Archives: python

Python Operators: Arithmetic, Comparison, Logical and more

Operators refer to special symbols in Python that carry out arithmetic or logical computation. An operand is generally a variable or a value on which we operate. 1. Python Operators There different types of python operators and we will discuss some of them below. Python Arithmetic Operator Python Comparison Operator Python Logical Operator Python Identity Operator Python Bitwise Operator Python ...

Read More »

Using Docker Compose for Python Development

Docker is an amazing tool for developers. It allows us to build and replicate images on any host, removing the inconsistencies of dev environments and reducing onboarding timelines considerably. To provide an example of how you might move to containerized development, I built a simple todo API with Python, Django REST Framework, and PostgreSQL using Docker Compose for development, testing, ...

Read More »

Python Built In Functions Example

Today we will be talking about some built-in functions in Python. Why are they important to know? Well, if you do import a lot of heavy libraries for simple tasks, that will be very inefficient. A good example of that is importing NumPy just to calculate the sum of elements in a row! So basically, built-in functions don’t need to ...

Read More »

Python Tkinter Tutorial

Today we will be talking about one python library that is used for GUI programming which is Tkinter.                     Table Of Contents 1. What is Tkinter? 1.1. More about Tkinter 1.2. Installing Tkinter 2. Examples 2.1. Basic examples 2.2. Widget 2.3. Frame 2.4. Event handling 3. Summary 4. Homework 5. Download ...

Read More »

Python NumPy Array Tutorial

Today we will be talking about one useful library that is used in data science. Now, why do we need a library and can’t use Python itself? Well, we can actually use Python itself, but once you get familiar with working in NumPy, you will see the difference.                 Table Of Contents 1. ...

Read More »

Python Try and Except Example

Today we will talk about one of the most important things in Python – exception handling. Firstly, let’s start with the definition of exceptions. They are errors detected while the program is being executed. So for example, if you write the program and you think it’s alright and try running it, it may give you some errors.       ...

Read More »

Python Datetime Tutorial

Today we will learn how to work with dates and time. It’s an essential skill because in almost every Python program you work with time one way or another. It can be really confusing at first how to work with them because we have dates, time, timezones, timedeltas. Table Of Contents 1. Introduction about datetime module 2. Examples 2.1. Basic ...

Read More »

Python Class Inheritance Example

Today we will be talking about OOP method of programming. The particular area of our interest would be Inheritance. Before we go any further, let’s talk about basic principles of programming. We know that there is an imperative method (when we use for and while loops), functional (when we operate with functions) or Object Oriented Programming (where we write code ...

Read More »