Unique In Order 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 …
403 articles about python development, tools, and best practices
Implement the function unique_in_order
which takes as argument a sequence and returns a list of items without any elements with the same …
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 Article →You are given a string of space-separated numbers and have to return the highest and lowest number.
Example:
high_and_low("1 2 3 4 …
Read Article →
Implement a difference function, which subtracts one list from another and returns the result.
It should remove all values from list a
, …
Given an integer numRows
, return the first numRows of Pascal’s triangle.
In Pascal’s triangle, each number is the sum of the …
Read Article →Create a function that takes 2 nonnegative integers in form of a string as an input, and outputs the sum (also as a string):
Example: ( …
Read Article →Everyone knows passphrases. One can choose passphrases from poems, songs, movies names and so on but frequently they can be guessed due …
Read Article →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 …
Automatons, or Finite State Machines (FSM), are extremely useful to programmers when it comes to software design. You will be given a …
Read Article →I will give you an integer. Give me back a shape that is as long and wide as the integer. The integer will be a whole number between 1 …
Read Article →Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string). …
Read Article →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.