#wemakedevs
Read more stories on Hashnode
Articles with this tag
Checks if a string is upper case. Convert the given string to upper case, using str.upper() method and compare it to the original. def...
Calculates the greatest common divisor between two or more numbers/lists. The helperGcdfunction uses recursion. The base case is when y equals 0. In...
Creates a list of elements, grouped based on the position in the original lists. Use max combined with a list comprehension to get the length of the...
Chunks a list into smaller lists of a specified size. Use range to create a list of desired size. Then use map on this list and fill it with splices...
Randomizes the order of the values of a list, returning a new list. Uses the Fisher-Yates algorithm to reorder the elements of the list. from copy...
Bubble_sort uses the technique of comparing and swapping def bubble_sort(lst): for passnum in range(len(lst) - 1, 0, -1): for i in...