Python String endswith() function

Python string endswith() function returns True if the input string ends with a particular suffix, else it returns False. Key Points: Return Type: Boolean i.e. True or False Parametric Values: There are 3 parameters: Suffix, Start, End Parameter Description Suffix It can be a String or Tuple of Strings that are to be checked. It …

Python String endswith() function Read More »

Python Custom Exceptions

An Exception is raised whenever there is an error encountered, and it signifies that something went wrong with the program. By default, there are many exceptions that the language defines for us, such as TypeError when the wrong type is passed. In this article, we shall look at how we can create our own Custom …

Python Custom Exceptions Read More »

How to Open Files in Python

Python gives us file handling methods within its standard library. This is really convenient as a developer since you do not really need to import any more modules for handling files. The key methods provided to us by the Python for file handling are open(), close(), write(), read(),seek() and append(). Let’s go over the open() …

How to Open Files in Python Read More »

Python Pendulum Module

Python’s pendulum module enables date/time conversions and manipulations. It helps the user to work easily with date/time formats. This module enables and provides all the functionalities provided by the pytz module. Installation of pendulum module through the command-line: Importing pendulum module: Display the current time The now() method is used to display the current date-time …

Python Pendulum Module Read More »

Python arrow module

Python arrow module enables date-time manipulations. It helps create instances and manipulate the timestamp accordingly. It shows a user-friendly approach to deal with the date-time conversions. Features: Arrow module is supported by Python 2.7 and higher versions. Time-zone aware Parses the string automatically Full level implementation Installing the arrow module: pip install arrow Access the …

Python arrow module Read More »

Python String upper() Function

Python String upper() function converts complete String into Uppercase and returns a new string. Strings are immutable in String, so the original string value remains unchanged. Key Points : Return Type: String Parametric Values: No parameters can be passed into the upper() function. Converts whole of string into uppercase It does not modify the original string. The …

Python String upper() Function Read More »

Python String islower() Function

Python String islower() function checks if all the characters in a string are lowercase then return True else False. Key Points : Return Type: Boolean i.e. True or False Parametric Values: No Parameters required It is not space-sensitive but case sensitive Empty String also returns False. String islower() Syntax str_name here refers to the input …

Python String islower() Function Read More »

Python String isupper() Function

String in Python has built-in functions for almost every action to be performed on a string. Python String isupper() function checks if all the characters in a string are uppercase then returns true else false. Key Points : Return Type: Boolean i.e. True or False Parametric Values: No Parameters required It is not space-sensitive but …

Python String isupper() Function Read More »

Python fractions Module

Python fractions module enables the user to manage fractions related computations in an efficient manner. This module enables us to create fractions from integers, floats, decimal, and strings. This fraction module supports rational number arithmetic operations. Basics of fractions module 1. Importing a fraction module: 2. Instantiate the fraction class: There are a number of …

Python fractions Module Read More »