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 1, 2022 | Programming, Python, Tips
If you try to call a float as if it were a function, you will raise the error “TypeError: ‘float’ object is not callable”. To solve this error, ensure you use operators between terms in mathematical operations and that you do not name any...
by Suf | Mar 1, 2022 | Programming, Python, Tips
In Python, Strings are arrays of bytes representing Unicode characters. Although Strings are container type objects, like lists, you cannot append to a string. If you try to call the append() method on a string to add more characters, you will raise the error...
by Suf | Feb 28, 2022 | Programming, Python, Tips
If you try to call a tuple object, you will raise the error “TypeError: ‘tuple’ object is not callable”. We use parentheses to define tuples, but if you define multiple tuples without separating them with commas, Python will interpret this as...
by Suf | Feb 27, 2022 | Programming, Python, Tips
We can measure temperature using two units: Celsius and Fahrenheit. We can convert temperature from degrees Celsius to degrees Fahrenheit using a formula. 12 degrees Celsius is equal to 53.6 degrees Fahrenheit. This tutorial will go through how to convert between the...