Question: Write a function add spaces (s) that takes an arbitrary string s as input and uses a loop to form and return the string formed
Write a function add spaces (s) that takes an arbitrary string s as input and uses a loop to form and return the string formed by adding a space between each pair of adjacent characters in the string. You may assume that s is not empty. Here are three examples: >>> add_spaces ('hello') hel1 o >>> add spaces ('hangman') h angman' >>> add spaces ('x') >>>print (add_spaces ('x'))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
