Category Python

String Comparison in Python (with Examples)

In Python or any other programming language, string comparison means identifying whether or not two strings are equivalent to each other. In this tutorial, we will learn how to compare two strings in Python with the help of the best…

String Concatenation in Python (with Examples)

String concatenation in Python

String concatenation means joining or combining two or more strings. Joining of two or more strings to make them one is called string concatenation in Python. In general, Python provides (+) operator to concatenate multiple strings. We can concatenate two…

String Slicing in Python

An example of string slicing in Python

String slicing in Python is a technique in which we can obtain a sub-part of the original string by specifying a range of index numbers separated by a colon. A sub-part of the original string is called substring. It is…

Strings in Python (with Examples)

Representation of Python strings

Strings in Python are a sequence of characters, which consist of one or more letters, numbers, punctuation marks, and spaces. For example, “Python” is a string which contains a sequence of six characters ‘P’, ‘y’, ‘t’, ‘h’, ‘o’ and ‘n’.…

Mutable and Immutable in Python

Mutable and immutable data types in Python

In this tutorial, we will learn about the meaning of mutable and immutable objects in Python with the help of examples. We know that everything in Python is an object. For example, objects or relation between objects represent all the…