How can you check if a word is found in a string using Python? Recently, I had an issue where I wanted to exclude strings from a list if they contained a certain word. I thought I could use the following common code familiar to most using … [Read more...] about Check For Word In String: Python 1 Liner
Blog
Sort List Of Dictionaries By Key: Python 1 Liner
How can you sort a list of dictionaries by a key contained in each dictionary using Python? Can you do it in 1 line to show off your friends? Of course! To sort a list of dictionaries use the sorted() function with the key parameter set to a … [Read more...] about Sort List Of Dictionaries By Key: Python 1 Liner
Python: Sort List From Second (or Nth Index) On
How do you sort a list by the second (or nth) element on in Python? How can you leave the first or nth elements in a list as they are but then have the remaining elements in the list sorted? When applying the .sort() list method on a list Python … [Read more...] about Python: Sort List From Second (or Nth Index) On
Reverse Order Of List In Python Without For Loops (Examples, One-Liners, No Imports)
There have been times when after creating a list in Python I've wanted to sort a list and then have the list reversed from ascending to descending. To reverse the order of a list in Python use either the .reverse() list method which mutates the … [Read more...] about Reverse Order Of List In Python Without For Loops (Examples, One-Liners, No Imports)
How To Use FORMULA In Filter Expression – SuiteScript 2.0
I had recently had to use a FORMULA type in a SuiteScript 2.0 search and found it as a very useful filter for list values. To use FORMULA types in a filter expression, such as, FORMULATEXT, FORMULAPERCENT, FORMULANUMERIC, FORMULACURRENCY or … [Read more...] about How To Use FORMULA In Filter Expression – SuiteScript 2.0
How Many Spaces Is A Tab: 2, 3, 4 or 5?
In Microsoft Word you can control whether or not you want to see the white space characters in your document. This helps to check you haven't incorrectly inserted a tab where a space should have gone and vice versa. Generally, a tab is the same … [Read more...] about How Many Spaces Is A Tab: 2, 3, 4 or 5?