by Suf | Mar 7, 2022 | Programming, Python, Tips
The built-in Python function round() returns a rounded version of a specified floating-point number to a specified number of decimal places. The round() function does not belong to the float data type. If you try to call the round() method on a floating-point number,...
by Suf | Mar 6, 2022 | Programming, Python, Tips
In Python, a list is a container object that stores elements in sequential order. A similar container object is the ndarray in the NumPy library. Every ndarray has an associated data type (dtype) which contains information about the array. However, lists do not have...
by Suf | Mar 6, 2022 | Programming, Python, Tips
In Python, the list data structure stores elements in sequential order. We can use the dictionary items() method to return a view object containing the key-value pairs of a dictionary. However, we cannot apply the items() method to a list. If you try to use...
by Suf | Mar 6, 2022 | Programming, Python, Tips
In Python, the list data structure stores elements in sequential order. We can use the dictionary values() method to return a view object containing the dictionary’s values as a list. However, we cannot apply the values() method to a list. If you try...
by Suf | Mar 6, 2022 | Programming, Python, Tips
In Python, the list data structure stores elements in sequential order. We can call the dictionary get() method to return the item’s value with the specified key. However, we cannot call the get() method on a list. If you try to call...
by Suf | Mar 5, 2022 | C++, DSA, Programming, Tips
Bubble sort is a popular sorting algorithm that compares the adjacent elements in a list and swaps them if they are not in the specified order. This tutorial will explain how to implement the bubble sort algorithm in C++ using code examples. Got some C++ code? Test it...