Python search string for a pattern | Example code
Use a Regex object’s search() method to search the string it is passed for any matches to the pattern in Python. Match objects have a… Read More »Python search string for a pattern | Example code
Use a Regex object’s search() method to search the string it is passed for any matches to the pattern in Python. Match objects have a… Read More »Python search string for a pattern | Example code
Use the [] operator on the tuple to Slice the tuple in Python. If using a positive number, it slices that index from the tuple… Read More »Slice tuple Python | Example code
Use the simple slicing operator i.e. colon(:) to Slicing a list in Python. The below expression returns the portion of the list from index Initial… Read More »Slicing a list in Python | Example code
Python if statement works on the boolean expression true and false statement. If true then the block will execute. Python boolean if example Simple example… Read More »Python boolean if statement | Basics
Python IF NOT statements mean inside if block executes only if the value(boolean) is False or if the value(collection) is not empty. Python IF NOT… Read More »Python IF NOT statement | Basics
While not loop works the same as a simple while loop, it will repeatedly execute the loop’s body until the condition for loop termination is… Read More »While not Python | Example code
There are 2 ways to remove the first character from a Python string. Example string removes the first character in Python Simple example code with… Read More »Python string remove the first character | Example code
Python’s new-style formatting allows for rearranging the order of display without changing the arguments. Of course, it is also possible to format integers (numbers). Python… Read More »Python string format integer | Example code
In Python programming, formatted string literals, are simply called “f-strings“. They are called f-strings because you need to prefix a string with the letter ‘F… Read More »Python f string format float | Example code
Getting a substring from a given string is called String slicing in Python. A simple way to do this is to use the simple slicing… Read More »String slicing in Python | Example code