#Python
The challenge
Write the following function:
def area_of_polygon_inside_circle(circle_radius, number_of_sides):
It should calculate the area of a …
Read Article →
#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 …
Read Article →
#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. …
Read Article →
#Python
The challenge
Find the longest substring in alphabetical order.
Example:
the longest alphabetical substring in "asdfaaaabbbbcttavvfffffdf" …
Read Article →
#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 on the …
Read Article →
#Python
The challenge
Given a triangle of consecutive odd numbers:
1
3 5
7 9 11
13 15 17 19
21 23 …
Read Article →
#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 …
Read Article →
#Python
The challenge
Given an integer as input, can you round it to the next (meaning, “higher”) multiple of 5?
Examples:
input: output:
0 …
Read Article →
#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. …
Read Article →
#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 Article →
#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, 32, …
Read Article →
#Python
The challenge
When provided with a letter, return its position in the alphabet.
Input :: “a”
Ouput :: “Position of alphabet: …
Read Article →