## How to Print to stdout in Flask using Python

If you are trying to print() to the console/stdout in your Flask app, but nothing is happening, then you just need to flush your prints,… Read More »How to Print to stdout in Flask using Python

If you are trying to print() to the console/stdout in your Flask app, but nothing is happening, then you just need to flush your prints,… Read More »How to Print to stdout in Flask using Python

If you have a Flask app that you would like packaged in a Docker container, then you can do the following. The steps outlined below… Read More »How to Dockerize a Flask App

Python gives the ability to generate random strings out of the box, by using a combination of the string and random modules.

The challenge The depth of an integer n is defined to be how many multiples of n it is necessary to compute before all 10 digits have appeared at least once in some… Read More »Determining Integer Depth in Python

The challenge Implement a function reverse_list that takes a singly-linked list of nodes and returns a matching list in the reverse order. Assume the presence of a… Read More »How to Reverse a singly-linked list in Python

The challenge In this challenge, you will be given a series of times at which an alarm goes off. Your task will be to determine… Read More »Calculating Simple Time Difference in Python

The challenge Given an integer n return “odd” if the number of its divisors is odd. Otherwise, return “even”. Note: big inputs will be tested. Examples: All prime numbers have… Read More »Calculating Odd/Even number of divisors in Python

The challenge In this challenge, you will be given an integer n, which is the number of times that is thrown a coin. You will have… Read More »Calculate possibilities of throwing a coin N times in Python

The challenge Hereinafter, [space] refers to ” “, [tab] refers to “\t”, and [LF] refers to “\n” for illustrative purposes. This does not mean that you can use these placeholders in your solution. In esoteric… Read More »How to Convert Integer to Whitespace format in Python

The challenge You have an array of integers and have a frog at the first position [Frog, int, int, int, …, int] The integer itself… Read More »How to Perform Frog Jumping in Python

The challenge Write the following function: It should calculate the area of a regular polygon of numberOfSides, number-of-sides, or number_of_sides sides inside a circle of radius circleRadius, circle-radius, or circle_radius which passes through… Read More »How to Calculate the area of a regular N sides polygon inside a circle of radius R in Python

The challenge You are developing an image hosting website. You have to create a function for generating random and unique image filenames. Create a function… Read More »How to create an Image Host Filename Generator in Python

The challenge Task Given string s, which contains only letters from a to z in lowercase. A set of the alphabet is given by abcdefghijklmnopqrstuvwxyz. 2 sets of alphabets… Read More »How to Find the Missing Alphabets in Python

The challenge Find the longest substring in alphabetical order. Example: the longest alphabetical substring in “asdfaaaabbbbcttavvfffffdf” is “aaaabbbbctt”. Overview: There are tests with strings up to 10 000 characters long… Read More »How to Find the Longest Substring in Alphabetical Order in Python

The challenge Write a function that takes in a binary string and returns the equivalent decoded text (the text is ASCII encoded). Each 8 bits… Read More »How to Binary to Text (ASCII) Conversion in Python

The challenge Given a triangle of consecutive odd numbers: find the triangle’s row knowing its index (the rows are 1-indexed), e.g.: Note: your code should… Read More »How to Find the Row of the Odd Triangle in Python

The challenge Write a function that takes a shuffled list of unique numbers from 1 to n with one element missing (which can be any number including n). Return this… Read More »Solving Number Zoo Patrol in Python

The challenge Given an integer as input, can you round it to the next (meaning, “higher”) multiple of 5? Examples: Input may be any positive… Read More »How to Round up to the Next Multiple of 5 in Python

The challenge Wilson primes satisfy the following condition. Let P represent a prime number. Then ((P-1)! + 1) / (P * P) should give a whole number. Your task is… Read More »How to satisfy Wilson Primes in Python

The challenge Christmas is coming and many people dreamed of having a ride with Santa’s sleigh. But, of course, only Santa himself is allowed to… Read More »Writing a Sleigh Authentication in Python

The challenge Return a new array consisting of elements which are multiple of their own index in input array (length > 1). Examples: [22, -6,… Read More »Solving for Multiple of Index in Python

The challenge When provided with a letter, return its position in the alphabet. Input :: “a” Ouput :: “Position of alphabet: 1” The solution in… Read More »How to Find an item’s Alphabet Position in Python

The challenge The make_looper() function takes a string (of non-zero length) as an argument. It returns a function. The function it returns will return successive characters of… Read More »How to write a Lazy Repeater Helper in Python

The challenge In this challenge, you will make a function that converts between camelCase, snake_case, and kebab-case. You must write a function that changes to a given case.… Read More »How to write a String Case Conversion Helper in Python

The challenge Create a function, that accepts an arbitrary number of arrays and returns a single array generated by alternately appending elements from the passed-in… Read More »How to create Interleaving Arrays in Python