How to Convert Integer to Whitespace format in Python
The challenge
Hereinafter, [space]
refers to " "
, [tab]
refers to "\t"
, and [LF]
refers to "\n"
for illustrative …
403 articles about python development, tools, and best practices
Hereinafter, [space]
refers to " "
, [tab]
refers to "\t"
, and [LF]
refers to "\n"
for illustrative …
You have an array of integers and have a frog at the first position
[Frog, int, int, int, ..., int]
The integer itself may tell you the …
Read Article →Write the following function:
def area_of_polygon_inside_circle(circle_radius, number_of_sides):
It should calculate the area of a …
Read Article →You are developing an image hosting website.
You have to create a function for generating random and unique image filenames.
Create a …
Read Article →Given string s
, which contains only letters from a to z
in lowercase.
A set of the alphabet is given by abcdefghijklmnopqrstuvwxyz
. …
Find the longest substring in alphabetical order.
Example:
the longest alphabetical substring in "asdfaaaabbbbcttavvfffffdf" …
Write a function that takes in a binary string and returns the equivalent decoded text (the text is ASCII encoded).
Each 8 bits on the …
Read Article →Given a triangle of consecutive odd numbers:
1
3 5
7 9 11
13 15 17 19
21 23 …
Read Article →
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 …
Given an integer as input, can you round it to the next (meaning, “higher”) multiple of 5?
Examples:
input: output:
0 …
Read Article →
Wilson primes satisfy the following condition. Let P
represent a prime number.
Then ((P-1)! + 1) / (P * P)
should give a whole number. …
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 Article →