# Python

## How to Convert an Int to a List of Ints in Python

The challenge Given a non-negative integer, return an array / a list of the individual digits in order. Examples: The solution in Python code Option… Read More »How to Convert an Int to a List of Ints in Python

## How to Create a Circular List in Python

The challenge Create a Circular List A circular list is of finite size, but can infititely be asked for its previous and next elements. This… Read More »How to Create a Circular List in Python

## Who is going to pay for the wall? in Python

The challenge Don Drumphet lives in a nice neighborhood, but one of his neighbors has started to let his house go. Don Drumphet wants to… Read More »Who is going to pay for the wall? in Python

## Find the missing element between two arrays in Python

The challenge Given two integer arrays where the second array is a shuffled duplicate of the first array with one element missing, find the missing… Read More »Find the missing element between two arrays in Python

## Compare within Margin using Python

The challenge Create a function close_compare that accepts 3 parameters: a, b, and an optional margin. The function should return whether a is lower than, close to, or higher than b. a is “close to” b if margin is… Read More »Compare within Margin using Python

## Remove the time challenge in Python

The challenge You’re re-designing a blog and the blog’s posts have the following format for showing the date and time a post was made: Weekday Month Day, time e.g.,… Read More »Remove the time challenge in Python

## Check if List contains Item in Python

The challenge Create a method that accepts a list and an item, and returns true if the item belongs to the list, otherwise false. Test cases The solution… Read More »Check if List contains Item in Python

## How to Remove Vowels with Python

The challenge Create a function called shortcut to remove all the lowercase vowels in a given string. Examples Don’t worry about uppercase vowels. Test cases The solution in Python… Read More »How to Remove Vowels with Python

## How to Sort a List in Python

In this tutorial, you will learn how to sort a list in Python, by following the below three steps: Options to sort a list in… Read More »How to Sort a List in Python

## How to divide a number in Python

The challenge Your task is to create functionisDivideBy (or is_divide_by) to check if an integer number is divisible by each out of two arguments. A few cases:… Read More »How to divide a number in Python

## How many times to Kaprekar’s constant using Python

Introduction 6174 is known as Kaprekar’s constant after the Indian mathematician D. R. Kaprekar. This number is notable for the following rule: Take any four-digit number, using at least two… Read More »How many times to Kaprekar’s constant using Python

## How to check if a String is a Number in Python

The challenge Given a string s, write a method (function) that will return true if its a valid single integer or floating number or false… Read More »How to check if a String is a Number in Python

## How to Write a Custom Comparator in Python

Generally, you want to use the built-in sorted() function which takes a custom comparator as its parameter. We need to pay attention to the fact that in… Read More »How to Write a Custom Comparator in Python

## How to Sort an Integer in Python

Let’s say that you have an integer with value of 9271 and you want to sort it either ascending(1279) or descending(9721). How would you do… Read More »How to Sort an Integer in Python

In this tutorial, you will learn how to upgrade PIP. You will also learn how to check the current version of PIP, as well as… Read More »How to Upgrade PIP

## How to Copy a File in Python

In this tutorial, you will learn how to copy a file using Python from a directory to another directory, or if you’re on Windows, then… Read More »How to Copy a File in Python

## Most frequently used words in a text with Python

The challenge Write a function that, given a string of text (possibly with punctuation and line-breaks), returns an array of the top-3 most occurring words,… Read More »Most frequently used words in a text with Python

## Sort Binary Tree by Levels using Python

The challenge You are given a binary tree: Your task is to return the list with elements from tree sorted by levels, which means the… Read More »Sort Binary Tree by Levels using Python

## How to Split a String with Python

Splitting a string in Python is really easy. You simply take a string and apply the split() method. “Your String”.split() See some examples of the… Read More »How to Split a String with Python

## Converting to PigLatin with Python

The challenge Move the first letter of each word to the end of it, then add “ay” to the end of the word. Leave punctuation… Read More »Converting to PigLatin with Python

## Multiples of 3 and 5 with Python

The challenge This challenge is a variation of the common FizzBuzz question. If we list all the natural numbers below 10 that are multiples of… Read More »Multiples of 3 and 5 with Python

## Counting smiley faces with Python

The challenge Given an array (arr) as an argument complete the function countSmileys that should return the total number of smiling faces. Rules for a smiling face:… Read More »Counting smiley faces with Python