Category Archives: Python

How To Get Substring Of A String In Python?

Generate Substrings Python

This is a quick tutorial on how you can generate different types of substrings from an existing string in python using string slicing method. Getting Different Substrings Of A String In Python Consider the following code. I’ve stored my name into a string variable fullString. Now, the following lines of code illustrate how you can […]

How To Get Current Time In Python?

Get Current Time In Python

This is a quick tutorial on how to get the current time in python. The most common and simplest ways to get time in python are discussed here with examples. Using the datetime package Python comes with a pre-installed datetime package. All you need to do is to import this package in your python program […]

Octal To Decimal Conversion In Python

Octal Decimal Conversion Python

This is a quick tutorial on how you can convert an octal number to decimal in Python. The vice-versa i.e. Decimal To Octal Conversion in Python is also explained. Octal To Decimal Conversion You can use the int function in python with base 8 to convert an octal number to its decimal form. The syntax […]

Python For Loop – Different Types of For Loops With Examples

Python For Loops

In any programming language, for loops are commonly used for iteration purposes. In Python for loop is used if you want a sequence to be iterated. The sequence could be anything like a list, a dictionary, a string, a set, etc. The usage of for loop in python is similar to most of the other […]