• 31 May

    Replace Tabs with Spaces in Python

    Tabs and Spaces in Python Tabs and spaces are required to add some gaps between characters. Space is fixed with single column width whereas a tab can have multiple column widths (usually two or four). In Python, we rely on indentation for defining blocks of codes so it is essential to know about spaces and […]

  • 25 May

    Count Decimal Places in Python

    How to count decimal places in Python? In Python, we can represent decimal values using the float datatype. The decimal point divides the integer from the fractional part. The maximum value a float object can have is 1.8 x 10^308. In this article, we will discuss how to count the decimal places in Python. We […]

  • 19 May

    Compare list elements with each other in Python

    In this post, we will see how to compare list elements with each other in Python. Compare all elements in list Python A list is a very useful iterable in Python. Every element is stored at a given index and can be accessed using this index. We can compare all elements in a list in […]

  • 12 May

    Extract Integer from String in Python

    How to extract integer from string in Python? A string can store a sequence of characters. These characters can be alphabets, numbers, special characters, and more. We will discuss how to extract integer from string in Python. Using the isdigit() function to extract integer from string in Python. In Python, the isdigit() function is used […]

  • Convert CSV to dictionary in Python
    09 May

    Convert CSV to Dictionary in Python

    CSV and Dictionaries in Python A CSV file is a comma-separated text file. It is very commonly used to transfer records and is compatible with Excel as well to store data in rows and columns. In Python, we can read CSV files easily using different functions. The pandas and csv module are used commonly to […]

  • How to unpack dictionary in Python
    22 March

    How to Unpack Dictionary in Python

    In this article, we will see how to unpack dictionary in Python. Dictionaries in Python A dictionary is one of the fundamental data structures of Python. It stores its elements as key-value pairs and has evolved with time. In recent versions of Python, dictionaries use hash functions which make accessing values from keys a fast […]

  • Format Date to YYYYMMDD in Python
    03 March

    Format Date to YYYYMMDD in Python

    Date formats in Python We can work with different modules to store a date in Python. Some of them are datetime, arrow, pendulum, and more. The format can vary from module to module. A date has three attributes year, month, and day. The order of these attributes determines the format of dates. The most basic […]

  • Get today's date in Python
    03 March

    Get Today’s Date in Python

    Date and Time objects in Python In Python, we can work efficiently with date and time values. The datetime module is used to create datetime objects that can store date and time values. We can work with different functionalities with such objects. Apart from the datetime module, we also have other packages like the arrow […]

  • Get HTML from URL in Python
    24 February

    Get HTML from URL in Python

    HTML pages with Python Webpages are made using HTML. It is the programming code that defines the webpage and its contents. It is at the core of every website on the internet. We can access and retrieve content from web pages using Python. Python allows us to access different types of data from URLs like […]