• Get filename from path in Python
    21 May

    Get filename from Path in Python

    There are different ways to define the path of the file. In Windows, the path separator for a file can be either a backslash or a forward slash. The ntpath module of Python will work on all platforms for all paths. The forwardslash / is used for UNIX and MacOS operating system and backslash \ […]

  • Convert unix timestamp to datetime in 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 […]

  • Add character to String in Python
    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 […]

  • Python round to 2 decimal places
    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 […]

  • Random number between 1 and 10 in Python
    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 […]

  • Last day of month in Python
    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 […]

  • Question mark in java
    20 May

    Question mark operator in java

    Learn about Question mark operator in java. It is also know as ternary operator.

  • Add days to date in Python
    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 […]

  • Vector of Structs in C++
    18 May

    Vector of structs in C++

    In this article, we will see how to initialize and use vector of structs in C++. There are different ways to do it. This article will explain these methods clearly. Using Range Constructor We can utilize the range constructor for the initialization of vector of structs in C++. It is useful when we need to […]