Python array list’s count method

In this example, we will use the count method from the Python array list to decide which phrase to return from a function that will […]

Find the first non-consecutive number with Python

Your task is to find the first element of an array that is not consecutive. E.g. If we have an array [1,2,3,4,6,7,8] then 1 then […]

Find the position of the only odd number within a list with Python

In this example, we will write a python function that will return the position of the only odd number within the number list. If there […]

Find the maximum gap between the successive numbers in its sorted form from a Python list

Given a Python list consists of plus or minus numbers, we need to sort that list then find the maximum gap between the successive numbers […]

Turn string into the score

You are working at a lower league football stadium and you’ve been asked to automate the scoreboard. The referee will shout out the score, you […]

Capitalize the letters that occupy even indexes and odd indexes separately

Given a string, capitalize the letters within the string that occupy even indexes and odd indexes separately, and return as a list! Index 0 will […]

Multiply according to the number of times

In this example, a root number and the number which indicates how many numbers of times that root number should get multiplied have been passed […]

Combine two strings with Python method

In this example, we are going to create a method which will do the followings:- Extract unique characters from two strings then group them into […]

Find the maximum value within a string with Python

In this chapter we are going to solve the above problem with a Python method. Given a string which consists of words and numbers, we […]