Built-in Methods

How to perform DNS lookups in Python, including /etc/hosts?

In this article, we’ll perform DNS Lookups in Python using the ‘socket’ module and ‘socket.getaddrinfo()’ function for generating the domain information and converting it into an IP address while using the /etc/hosts files for storing the generated IPv4 and IPv6 addresses of the domain. Prerequisites What is DNS lookup? Before learning what is DNS Lookup, …

How to perform DNS lookups in Python, including /etc/hosts? Read More »

Fixed digits after decimal with F-string

The F-string is a formatting te­chnique that allows Python programmers to format strings quickly and easily. By adding the­ letter ‘f’ as a prefix in the­ syntax, developers can utilize­ this popular method for its efficient e­xecution and straightforward syntax. Its convenience­ surpasses alternatives such as the­ str. format() method or % formatting. This narrative …

Fixed digits after decimal with F-string Read More »