Pythons find() Method: How to Search for Substrings within a String?

The find() method finds the specified word or substring into a string and returns the index of its first character. In case if it doesn’t find the substring then it returns -1

Check if String Ends with Specified Substring using endswith() Method in Python

The endswith() method checks if the string ends with a specified substring. The endswith() function has three parameters in which the first is mandatory and two are optional.

Convert Strings into Lowercase in Python

Python has two built-in methods that convert capitalized alphabetic letters into lower case which are casefold() and lower().

Convert First Character of String into Uppercase in Python

You can convert the first character into uppercase through capitalize() method.

How to Access List Elements in Python?

In Python you can access an element from the list through the index number. To access an element you need to attach a square bracket and add the index number that needed to access.

What are Comparison Operators in Python?

Comparison operator compares two values in the if-statement. There are six comparison operators in Python programming language.

How to Convert Float to Int in Python?

Float value can be converted into an integer by using Python’s built-in function int(). It converts the first argument’s data type into an integer.

How to Convert String into Integer in Python?

You can use Python’s built-in int() function to convert the string into an integer. It accepts two parameters which first is required and the second is optional.

How do you get business days count between two dates in Python?

You need to use the date() class from the datetime module and busday_count() method from the numpy module to get business days count between two dates.

How to Change a Date Format in Python?

Learn to change the format of a given date in python. The datetime class accepts three parameters. First is the year, second is the month and third is the day.

How to Convert Date String to Different Format in Python?

To convert a date string into a different format, first, you need to convert it into a datetime object through strptime() function.

How do I Get the Current Time in Python?

We can get the current time through the datetime module and strftime() function. The datetime module provides the current time and strftime() function represents it.

How to Get the Current Day, Month, and Year in Python?

To get the current day, month, and year in python we can use the datetime class from the datetime module that provides different classes to deal with date and time.

How to Concatenate Strings and Variables in Python?

In python, the ‘+’ operator is used to concatenate two strings. Let’s Suppose, to concatenate “Hello” and “World”, you need to use the ‘+’ operator in between.

What is Type Casting in Python 3?

Every value has a specific data type, when we change the data type of value from one to another is called type casting.

How to use Variables in Python 3?

Variables are data storage that stores provided data to specified variables. In python you can declare a variable without any symbol.

How to install Python 3 on Windows?

Go to Python’s official website and click on the download page. Or you can directly open the page where installer files are listed for different operating systems.