Exception Handling in Python for Python Programming

1. Objective In our previous lesson on Errors and Exceptions in Python, we read about python exceptions in brief. Now that we’re familiar with it all, it’s time to learn how to handle such situations effectively. In this tutorial, we’ll also learn how to create our own exceptions and do exception handling in python. 2. Exception Handling in Python As we have already seen different types of exceptions in python, let us see various ways for exception handling in python […]

Exception Handling in Python

Python exceptions

Errors and Exceptions in Python Programming   Recently updated !

1. Objective Life is going on great. You’re having a good time with Python when your code suddenly blows up when you finally run it. What could have possibly caused this? The code seemed all okay. To deal with such situations, we bring this tutorial to you which covers errors and exceptions in python. It will cover all possible python errors and python exceptions to help you in running your python code smoothly as there are many reasons why to […]

Recursion in Python with Examples

1. Objective A few lessons back, we introduced you to Functions in Python. In that, we saw how to define our own functions, how to call them, and also learned some in-built functions. The last topic we discussed in brief was recursion in python. In this python tutorial, we will expand python recursion with syntax and examples for better understanding. 2. Introduction to Recursion in Python According to the Oxford English Dictionary, recursion is the repeated application of a recursive […]

Recursion in Python

Classes in Python

Python Classes and Object Oriented Programming   Recently updated !

1. Objective Like we’ve often said, Python is an object-oriented language. This means it focuses on objects instead of procedures. An object can model the real world. So now, in our series of Python tutorials, we move forward to object-oriented programming and learn the concepts of Python classes. 2. Introduction to Python Classes A class is a blueprint for objects- one class for any number of objects of that type. You can also call it an abstract data type. Interestingly, […]

Python List Comprehension with Syntax and Examples   Recently updated !

1. Objective Previously, we discussed about Lists in Python. In that tutorial, we mentioned that we can use a list comprehension to create a list. Today, we’ll expand on Python list Comprehension. 2. Introduction of Python List Comprehension To get comprehensions back into memory, we’ll take a quick example. Suppose you want to take the letters in the word ‘anxiety’, and want to put them in a list. Remember that a python string is an iterable. Using a for loop, you would: […]

Python List Comprehension

python generators

Python Generators and Generator Expressions

1. Objective In Python, we’ve learned about Python functions. In that, we’ve seen in-built and user-defined functions. But in this tutorial, we will discuss Python generators and how to use generators in python. To find out, read more. 2. An Introduction to Python Generators A generator is a kind of an iterable, like a Python list or a python tuple. It generates for us a sequence of values that we can iterate on. You can use it to iterate on […]

Decorators in Python – Decorator Functions

1. Objective In Python, a function is a first-class object. This means that you can pass it around with absolute ease. You can return it, and even pass it as an argument to another. You can also nest a python function inside another. In this python tutorial, we will make use of all of these concepts to learn about decorators in Python. 2. Introduction to Decorators in Python Decorator function in Python is a function that adds functionality to another, […]

Decorators in python

scala vs python

Scala vs Python – Difference between Python and Scala

1. Objective To get the best of your time and efforts, you must choose wisely what tools you use. For this purpose, today, we compare two major languages, Scala vs Python to understand which of python vs scala for spark is best option for learning. 2. Introduction to Scala vs Python But before we begin with the comparison, we must make small talk about Scala. An object-oriented programming language, Scala was designed by Martin Odersky in 2004. Scala gets its name […]

Range Function in Python – Range() in Python   Recently updated !

1. Objective Something you’ve always seen with a for loop, python range() function is a handy feature in Python. Like we saw in our tutorial on Python Loops, range function in python provides us with a list of numbers to iterate on. Actually, it returns a range object, which we then convert to a list to iterate on. Let’s begin. 2. Introduction to Range function in Python The range() function is an in-built function in Python, and it returns a […]

Range Function in Python

Comparison Operator in python

Comparison Operator in Python with Syntax and Examples   Recently updated !

1. Objective In our previous article, we talked at length about Python bitwise operators. Today, we focus our words on comparison operator in python. These are also called relational operators. Let’s see them one by one. Before starting, let us revise Python syntax once. 2. Introduction to Comparison Operator in Python A comparison operator in python, also called python relational operator, compares the values of two operands, and returns True or False based on whether the condition is met. We […]