## How to Reverse Words in Python

The challenge Complete the function that accepts a string parameter, and reverses each word in the string. All spaces in the string should be retained. Examples The… Read More »How to Reverse Words in Python

The challenge Complete the function that accepts a string parameter, and reverses each word in the string. All spaces in the string should be retained. Examples The… Read More »How to Reverse Words in Python

The challenge Create a function with two arguments that will return an array of the first (n) multiples of (x). Assume both the given number… Read More »How to Count by X in Python

The challenge Given a list of integers and a single sum value, return the first two values (parse from the left please) in order of… Read More »Calculate the Sum of Pairs in Python

If you have a large list and want to create smaller lists of it, with a maximum amount of elements, then: This will look like:

If you want to print out a list of all dates between 2 dates (a date range), then you can use the following script: This… Read More »Get all dates between two dates inclusive in Python

If you want to append a Python dictionary to a Pandas DataFrame, you can do this: Notice the reassignment output = output.append(…)

You can store secrets in AWS Secret Manager and reference their ARN in AWS Systems Secret Manager. The below snippet allows you to specify the… Read More »Get Secret from AWS Secrets Manager in Python

The challenge Implement a function that adds two numbers together and returns their sum in binary. The conversion can be done before or after the… Read More »How to do Binary Addition in Python

You have successfully written your pandas Dataframe to an Excel file, but when you open it, all the columns are squashed up against each other.… Read More »How to Auto-Adjust Excel column widths with pandas.ExcelWriter

The challenge You will be given an array of numbers. You have to sort the odd numbers in ascending order while leaving the even numbers… Read More »How to Sort the Odd in Python

The challenge Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 positive integers. No floats… Read More »Calculate the Sum of the two lowest positive integers in Python

The challenge Implement the function unique_in_order which takes as argument a sequence and returns a list of items without any elements with the same value… Read More »Unique In Order in Python

The challenge Given a string, replace every letter with its position in the alphabet. If anything in the text isn’t a letter, ignore it and… Read More »How to Replace Characters with Alphabet Positions in Python

The challenge You are given a string of space-separated numbers and have to return the highest and lowest number. Example: Notes: All numbers are valid Int32,… Read More »Returning Highest and Lowest in Python

The challenge Implement a difference function, which subtracts one list from another and returns the result. It should remove all values from list a, which are… Read More »How to Subtract Arrays in Python

The challenge Given an integer numRows, return the first numRows of Pascal’s triangle. In Pascal’s triangle, each number is the sum of the two numbers directly above it… Read More »How to Solve Pascal’s Triangle in Python

The challenge Create a function that takes 2 nonnegative integers in form of a string as an input, and outputs the sum (also as a… Read More »How to Sum The Strings in Python

The challenge Everyone knows passphrases. One can choose passphrases from poems, songs, movies names and so on but frequently they can be guessed due to… Read More »Playing with passphrases in Python

The challenge You are given an m x n binary matrix grid. An island is a group of 1‘s (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four… Read More »Find the Max Area of an Island in Python

The challenge Automatons, or Finite State Machines (FSM), are extremely useful to programmers when it comes to software design. You will be given a simplistic… Read More »A Simplistic TCP Finite State Machine (FSM) in Python

The challenge I will give you an integer. Give me back a shape that is as long and wide as the integer. The integer will… Read More »How to Build a Square in Python

The challenge Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string). Examples:… Read More »Check if String EndsWith in Python

Python comes with a built-in method on all String types, by calling lower() on a String, you can immediately lower the case of that String.… Read More »How to LowerCase a String in Python

If you have a decimal number, and want to get it’s binary value, you can use the built-in bin method. We can see that it… Read More »Number to Binary Conversion in Python

The challenge A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the… Read More »Counting Binary Gaps with Python