A little about Python strftime() function
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.
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.
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 of
In this tutorial, you are going to learn how to get current date and time by now() function of Python datetime() module.
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 requirement
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,
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:
Python supports a number of ways for removing the file or directories from the specified path. Each of these ways is described below which is followed by examples.
The index function searches a list and returns the position of first matched item in the specified list. – The index starts at zero
The zip function returns an iterator of tuples that aggregates elements from each of the given iterables. For example:
The Python float function converts a given value into float. The float function takes an argument that can be a number or string with decimal point.
The int function in Python is used to convert a given value into an integer.The function returns an integer object. The object is constructed from the given string or number. If no arguments are given then it returns 0.
The bytes and bytearray are the core built-in types in Python to manipulate binary data. The bytes function returns bytes object which is immutable sequence of single bytes.
The enumerate function takes an iterable like a list, tuple etc. and returns it as an enumerate object. The function adds counter to the iterable. For example
Python makes it quite easy creating the random numbers whether it is the matter of creating random number within a range, integer numbers as well as generating floating random numbers.