How to Double Characters in Python
The challenge
Given a string, you have to return a string in which each character (case-sensitive) is repeated once.
double_char("String") …
Read Article →
403 articles about python development, tools, and best practices
Given a string, you have to return a string in which each character (case-sensitive) is repeated once.
double_char("String") …
Read Article →
Complete the function that accepts a string parameter, and reverses each word in the string. All spaces in the string should be …
Read Article →Create a function with two arguments that will return an array of the first (n) multiples of (x).
Assume both the given number and the …
Read Article →Given a list of integers and a single sum value, return the first two values (parse from the left please) in order of appearance that …
Read Article →If you have a large list and want to create smaller lists of it, with a maximum amount of elements, then:
commands = [str(i) for i in range(100)] …
Read Article →
If you want to print out a list of all dates between 2 dates (a date range), then you can use the following script:
from datetime import date, …
Read Article →
If you want to append a Python dictionary to a Pandas DataFrame, you can do this:
# Create a new DataFrame
output = pd.DataFrame()
# Append the …
Read Article →
You can store secrets in AWS Secret Manager and reference their ARN in AWS Systems Secret Manager.
The below snippet allows you to specify the …
Read Article →Implement a function that adds two numbers together and returns their sum in binary. The conversion can be done before or after the …
Read Article →You have successfully written your pandas
Dataframe
to an Excel file, but when you open it, all the columns are squashed up against each other.
There …
Read Article →You will be given an array of numbers. You have to sort the odd numbers in ascending order while leaving the even numbers at their …
Read Article →Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 positive integers. No floats or …
Read Article →