What are the most common string operators used in Python and why they're essential to know? It doesn’t take long when you begin programming in Python to work with strings and to start modifying...
Category: Python
How To Remove File Extension From Path String In Python: One-Liner
How do you remove the file extension from a path in Python? And can you do it using just one line of code? The file extension is generally the last set of characters after the final period in a...
What does [:-1] in Python actually do and why would you want to use it? [:-1] in Python is a slice operation used on strings or lists and captures all contents of the string or list except for the...
What operator is used to raise a number to a power in Python? In Python the double asterisk operator ** is used to help calculate the exponent of a number raised to a power. This is done without a...
What does the asterisk before a variable name mean in Python? For example, if I have a variable that contains a list of strings and the name of the variable is called my_list what does *my_list...
What Does Colon Equals Mean In Python? The New Walrus Operator :=
In Python 3.8 a new assignment expression hit allowing for easier access of variables that are used when being assigned. Here are some tips on how this can be used in your everyday coding. Wait,...