Python
- 21 May
Convert Unix timestamp to DateTime in python
A UNIX timestamp is defined as the several numbers of seconds between a particular date and the Epoch i.e January 1, 1970 at UTC. In this tutorial, we will see some methods by which we can convert a UNIX timestamp to DateTime in Python. Using fromtimestamp() Function DateTime module in python is used to deal […]
- 21 May
Add character to String in Python
Strings are considered as a sequence of characters in programming. In Python, string objects are considered immutable. What this means is that string objects cannot be changed once created, and a new string is created with a different block of memory when we edit a string. In this article, we will discuss how to add […]
- 21 May
How to round to 2 decimals in Python
In Python, we deal with integers, floating values, and even imaginary numbers. Float numbers are used to represent the real numbers with integers and decimal parts. Python represents such numbers with 64-bit precision giving it a range of almost 1.8 x 10^308. In this article, we will discuss how to round float values to 2 […]
- 21 May
Generate random number between 1 and 10 in Python
Random numbers have very important applications in the world of programming. They can be used to create simulations, test cases for statistical or cryptoanalysis, for creating situations where we require a random or unpredictable result, and more. In Python, we can generate a wide range of ragndom numbers using different modules and functions. In this […]
- 20 May
Get last day of month in Python
In this article, we will discuss how to find the last day of the month in Python using different modules. Using the calendar.monthrange() function The monthrange() function is used to return a tuple containing the first weekday of the month and the total number of days in the month. We have to pass the year […]
- 19 May
Add days to date in Python
In python, we deal with a lot of date and time-related problems. There is no specific data type for date and time still there is a lot of manipulation done on them in python. We can perform many tasks related to date and time by importing in-built modules and packages. Tasks like conversion of date […]
- 16 May
Python find number in String
Extracting specific letters, phrases, words, and some specific characters is a very generic thing to do in the world of programming. In all these tasks, extraction of numbers and their occurrences from a string or a set of a string is also carried out very often by the user. Users can carry this task in […]