How to Reversing Words in a String in Python
The challenge
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 →403 articles about python development, tools, and best practices
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 →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, …
We want an array, but not just any old array, an array with contents!
Write a function that produces an array with the numbers `` to N-1 …
The below Python code will create a connection to a MSSQLServer instance, and retrieve data from it back into a variable called tblResults
.
# use …
Read Article →
Numbers ending with zeros are boring.
They might be fun in your world, but not here.
Get rid of them. Only the ending ones.
1450 -> …
Read Article →