Writing Comments in Python

Python multiline comment

For single line comments, you may use the # (hash character) in the Python programs. For multi-line comments, use the triple quoted strings. Both of these ways are explained.

Python switch case Statement

Python switch case

The official site suggests using the if…elif…elif..else statements for the limited number of possibilities (say up to 12 or so). However, for a very large number of possibilities, you may create a dictionary.

Python startswith Method

Python startswith

The startswith is a string method that returns True if the specified string starts with the given prefix. In order to check the suffix from last of the string, use the endswith method.

Python or Operator

An infographic providing an in-depth exploration of the Python or operator. Enhance your understanding of logical operations in Python.

The ‘or’ in Python is a logical operator that evaluates as True if any of the operands is True, unlike the ‘and’ operator where all operands have to be True.

Reverse Strings in Python

An image tutorial on reversing strings in Python. Explore step-by-step methods for reversing text and manipulating data.

How to reverse strings in Python There is no specific method of the str object to reverse a string in Python like the list reverse method, you may use a number of techniques to reverse a string. One of the ways is using the extended slice. The second way the is reversed() method with join() … Read more

Python type() Function

Explore the Python type() function visually. Understand how it reveals the types of objects, enabling dynamic type checking and enhancing your programming proficiency.

By passing the object to the type() function, the single required parameter, it returns the type of the object like a list, integer, float, tuple etc.

Python String find Method

The find() method returns the index number of the first occurrence of the given search term in the specified string. If the specified string does not contain the search term, the find() returns -1.

What is Python slice?

A visual tutorial on slicing and dicing data with Python. Discover the flexibility of slice notation and slice objects for customizing data extraction.

The slicing is a Python methodology that enables accessing parts of data from the given sequence like lists, tupes, strings etc. and objects that support sequence protocol.

Python continue statement

Python continue

The continue statement is used in the for and while loops in Python to omit the execution for current iteration. Any statements after the continue statement within the loop will be neglected and execution…