• 02 October

    Get Temp Directory in Python

    Sometimes we can encounter scenarios where we wish to store temporary data in Python. This can include situations of creating temporary files and directories. In this tutorial, we will discuss how to get temp directory in Python. Get Temp Directory in Python The tempfile module is used in Python to work with and create temporary […]

  • 02 October

    Replace Single Quotes with Double Quotes in Python

    In Python, strings represent a collection of characters and can be operated on easily using different functions. In this tutorial, we will discuss different methods to replace single quotes with double quotes in Python. Replace Single Quotes with Double Quotes in Python There are multiple way to replace single quotes with double quotes in Python. […]

  • 27 September

    Print Number without Decimal in Python

    Python provides a float data type that allows the storage of floating-point numbers. The data at the decimal places is also retained while using the float data type. However, sometimes there is a need to access only the whole number rather than including the decimal part. This tutorial discusses the different ways available to print […]

  • 26 September

    Get List of Weekday Names in Java

    In this post, we will see how to get list of weekday names in Java. Using DateFormatSymbols’s getWeekdays() method We can use DateFormatSymbols's getWeekdays() to get list of weekday names in Java. It will provide complete weekday names like Sunday, Monday etc. [crayon-678d57b0de88b146056903/] Output [crayon-678d57b0de88e259718328/] Using DateFormatSymbols’s getShortWeekdays() method [For short names] If you need […]

  • 26 September

    Print hex without 0x in Python

    A hex or a hexadecimal string is one of the few forms of data types provided by Python for storing and representing data. A hex string is generally represented with a prefix of 0x. However, we can get rid of this 0x and print just the original hex value. This tutorial focuses on and demonstrates […]

  • 26 September

    Check if Date Is Between Two Dates in Python

    Python allows us to store and work with date values very efficiently by providing the datetime module. This module has datetime objects that can store date and time values. There are other third-party packages as well that allows us to work with such values. We can also store dates as strings in Python. In this […]

  • 26 September

    Prefix r before String in Python

    💡 Quick Definition Prefix r before String denotes raw Strings in Python. Python raw string considers backslash (\) as a literal character. This is generally preferred when you don’t want to treat backslash character as escape character. Here is an example: [crayon-678d57b0dec39524500876/] Output: \n \t are escape characters in Python Escape sequences provide an efficient […]

  • 26 September

    Print bytes as hex in Python

    Print Bytes as Hex in Python Bytes are encoded in ASCII and have a very dynamic role in Python. In Python 2, they were merely an alias to strings. However, Python 3 changed its definition as strings were now encoded as Unicode characters instead of ASCII encoded bytes. Since bytes are ASCII encoded, the characters […]

  • 24 September

    Display Negative Number in Parentheses in Java

    In this post, we will see how to display negative number in Parentheses in Java. We can use pattern #,##0.00;(#,##0.00) with DecimalFormat‘s format() to display negative number in Parenthesis in Java. [crayon-678d57b0dee02817737510/] Output [crayon-678d57b0dee05555533632/] If you don’t need decimal places, you can change to pattern to: [crayon-678d57b0dee06242146860/] Let’s understand meaning of pattern #,##0.00;(#,##0.00): First part […]