You have written an essay for school, and it has to be at least five pages long. But your essay is only 4.5 pages long! You decide to use your new Python skills to make your essay longer by spacing out the letters. Write a function that takes a string and a number of spaces to insert between each letter, then print out the resulting string.

```
def spaceitout(astring, number):
pile = ""
space = " "
for index in range(0,len(astring)-1):
pile = pile+ astring[index]+number*space
pile+=astring[len(astring)-1]

print pile
```


Note: The question specifically calls for spaces to be inserted between each letter.
Therefore, a solution such as:

```
def spaceitout(astring, number):
pile = ""
space = " "
for index in range(0,len(astring)):
pile = pile+ astring[index]+number*space
print pile
```
Would be close, but actually have extra spaces after the final character as well.

Computer Science & Information Technology

You might also like to view...

The expression

``` x *= i + j / y; ``` is equivalent to ______. a. x = x * i + j / y; b. x = (x * i) + j / y; c. x = (x * i + j) / y; d. x = x * (i + j / y); e. none of the above

Computer Science & Information Technology

What is the output of the following code?

``` #include using namespace std; class Foo { public: int x; // data field int y; // data field Foo() { x = 10; y = 10; } void p() { int x = 20; // local variable cout << "x is " << x << " "; cout << "y is " << y << endl; } }; int main() { Foo foo; foo.p(); return 0; } ``` a. x is 20 y is 10 b. x is 10 y is 20 c. x is 20 y is 20 d. x is 10 y is 10

Computer Science & Information Technology

A chart layout is a predefined set of chart colors and fills.  __________________________

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Case Based Critical ThinkingMark finds that many of his designers are mostly Photoshop gurus and aren't fully up to speed with using the Pen tool to draw objects in Illustrator, and because of this, much of their line work and choices for stroking effects are unsatisfactory. He also finds that they are unaware of the basic concepts behind the Live Paint feature and how they relate to standard Illustrator working methods. Mark finds that his designers don't know any of the terms used to describe different components of a path. He tells his designers to compare a path drawn with the Pen tool to a road through the woods. With that analogy, a smooth point would occur at these places in the road:

A. curves B. hills C. corners D. steps

Computer Science & Information Technology