The any() function in Python returns True if any elements of the iterable is True. The any() function takes an argument which is the iterable e.g. a list, dictionary, string, tuple etc.Demos and Full Guide
The ‘%’ or modulus operator is generally supported in many languages and so in Python. In this tutorial, we will look at ‘%’ operator and string.format() function for string formatting in Python.Demos and Full Guide
In Python, you may use different ways for calculating the exponents. All these are explained in this tutorial with example code.Demos and Full Guide
The floor function is the part of math module that returns the floor of given number (x) which is largest integer number less than or equal to the x. For example:Demos and Full Guide
In Python and generally speaking, the modulo (or modulus) is referred to the remainder from the division of the first argument to the second.Demos and Full Guide
In this tutorial, I will show you examples of getting the factorial by both ways: Using the math module’s factorial function and writing a custom function for getting the factorial.Demos and Full Guide
The abs() function returns the absolute value of the given number in Python. The abs() function takes an argument which is the number that you want to get the absolute value.Demos and Full Guide
The timedelta is the class in datetime module that represents duration. The delta means average of difference and so the duration expresses the difference between two date, datetime or time instances.Demos and Full Guide
As the name suggests (str f time), Python strftime() function returns the string representation of the date. The strftime() takes an argument where you may specify the format of date to be returned.Demos and Full Guide
In Python, you may convert a date to string that is in easy readable format to the users by different ways. Being able to format date by string conversion is important as the default way ofDemos and Full Guide
In this tutorial, you are going to learn how to get current date and time by now() function of Python datetime() module.Demos and Full Guide
In this tutorial, I am specifically explaining how to write content to a text file using Python. Without importing any module, you may use the open() function and depending on the requirementDemos and Full Guide
In this tutorial, I will explain how to perform certain operation on text files using Python built-in functions. The examples in the coming section shows opening a text file, reading,Demos and Full Guide
This is how reduce function works: It will apply the given function of two arguments to the items of iterable e.g. a list, cumulatively.
The items of sequence are entertained from left to right and the function will “reduce” the sequence to a single value.
In this tutorial, four different ways are described with example code for how to check if a file exists or not. These methods include:Demos and Full Guide