by Suf | Dec 22, 2021 | Programming, Python, Tips
In Python, a dictionary is stores data in key:value pairs. Python 3.7 dictionaries are ordered data collections; Python 3.6 and previous dictionaries are unordered. In a Python dictionary, all keys must be hashable. If you try to use the unhashable key type...
by Suf | Dec 22, 2021 | Programming, Python, Tips
In Python, a function is a block of code that only runs when called. You can pass data, known as parameters or arguments, to a function, and a function can return data as a result. To call a function, you must use the function name followed by parentheses () and pass...
by Suf | Dec 21, 2021 | Programming, Python, Tips
The square of a number results from multiplying a number by itself. The square of the number is the same as raising the number to the power of two. For example $latex 8 \times 8 = 64$, which is equal to $latex 8^{2}$ as well. The square of real numbers is always...
by Suf | Dec 21, 2021 | Programming, Python, Tips
In Python, a dictionary is stores data in key:value pairs. Python 3.7 dictionaries are ordered data collections; in Python 3.6 and previous dictionaries are unordered. You cannot perform a slice on a Python dictionary like a list. Dictionaries can have custom key...
by Suf | Dec 21, 2021 | Programming, Python, Tips
Integers and iterables are distinct objects in Python. An integer stores a whole number value, and an iterable is an object capable of returning elements one at a time, for example, a list. If you try to iterate over an integer value, you will raise the error...