Sireesha

How to compare strings in Python? (‘is’ vs ‘==’)

In this tutorial, you will learn how to compare strings in Python. Table Of Contents Compare strings using ‘==’ operator Compare strings using ‘!=’ operator Compare strings using ‘>’ operator Compare strings using ‘>=’ operator Compare strings using ‘<‘ operator Compare strings using ‘<=’ operator Compare strings using is operator Difference between is & ‘==’

How to compare strings in Python? (‘is’ vs ‘==’) Read More »

How to remove a trailing newline in Python?

In this Python tutorial, you will learn how to remove a trailing newline from a string in Python. Table Of Contents what is trailing newline? Remove trailing newline characters using rstrip() Remove trailing newline using regex module Remove newline characters using replace() function Remove trailing newline characters using strip() Summary Let’s dive into the tutorial.

How to remove a trailing newline in Python? Read More »

How to manually raise / throw an exception in Python?

In this Python tutorial, we will discuss how to manually raise or throw an exception. Table Of Contents Exceptions in Python Manually raise ZeroDivisionError exception using raise statement Manually raise TypeError exception using raise statement Manually raise ValueError exception using the raise statement Summary Let’s dive into the tutorial. Exceptions in Python When our application

How to manually raise / throw an exception in Python? Read More »

How to use “not equal” operator in Python?

In this Python tutorial, you will learn how to use the “not equal” operator in Python. Table Of Contents “not equal” operator (!=) in Python “not equal” Operator ( != ) in conditional statements “not equal” operator (!=) in Loops in Python “not equal” operator (!=) with Data Structures in Python Summary Let’s dive into

How to use “not equal” operator in Python? Read More »

Scroll to Top