Hello, Name or World in Python
The challenge
Define a method hello that returns “Hello, Name!” to a given name, or says Hello, World! if name is not given (or passed as …
In-depth guides, insights, and best practices for modern software engineering
Define a method hello that returns “Hello, Name!” to a given name, or says Hello, World! if name is not given (or passed as …
What if we need the length of the words separated by a space to be added at the end of that same word and have it returned as an array? …
Read Article →Write a function that reverses the words in a given string. A word can also fit an empty string. If this is not clear enough, here are …
Read Article →Define a function that removes duplicates from an array of numbers and returns it as a result.
The order of the sequence has to stay the …
Read Article →The company you work for has just been awarded a contract to build a payment gateway. In order to help move things along, you have …
Read Article →Write a function that always returns 5
Sounds easy right? Just bear in mind that you can’t use any of the following characters: …
Read Article →Implement a function named generateRange(min, max, step), which takes three arguments and generates a range of integers from min to max, …
Read Article →“Blue/Green Deployments” is a software deployment methodology. A terminology to suggest two mostly equal …
Read Article →Complete the function that takes a non-negative integer n as input, and returns a list of all the powers of 2 with the exponent ranging …
Create a function that takes in an id and returns the planet name.
Option 1:
def get_planet_name(id): …
Read Article →
If you want to create a directory in Python, but only if it doesn’t exist, you have the following option.
from …
Read Article →
Complete the square sum function so that it squares each number passed into it and then sums the results together.
For example, for [1, …