AAfizinafiz.hashnode.dev路Dec 16, 2022 路 1 min readDouble-Ended Queues in PythonThe regular queue data structure follows FIFO(First in First Out) rule. Queue is a great data structure, but when it comes to adding elements at the end or removing elements from the beginning, it gets complicated. This is where Double-Ended aka dequ...00
AAfizinafiz.hashnode.dev路Sep 18, 2022 路 3 min readData Types in Python (with code snippets)In Python, every value has a data type. There are various data types and in this thread we will discuss some of the important ones. Python Numbers Numbers are three types Integers floating point numbers complex numbers # integer age = 30 # ...00
AAfizinafiz.hashnode.dev路Sep 16, 2022 路 1 min readHow to get the city details with zipcode in PythonIn this program, we will learn how to extract city details using zipcode in Python. First, we need to install geopy. Run the below command to install geopy pip install geopy Here is the main program 馃憞 from geopy.geocoders import Nominatim locato...00
AAfizinafiz.hashnode.dev路Jun 6, 2022 路 1 min readFactorial program in PythonMethod 1: Finding the factorial of a given number using for loop def factorial(number): output = 1 if number < 2: return output else: for i in range(2, number+1): output *= i return output print(factorial(...00
AAfizinafiz.hashnode.dev路Jan 15, 2022 路 1 min readHow to delete duplicates from a list in PythonIn this post, we will discuss how to remove duplicates from a list in Python. There are many ways to delete duplicates from a list, but I find these two methods easy and readable. Using sets Using fromkeys method of dict Please take a look the e...00