3.16 you have written an essay for school, and it has to be for at least five pa
ID: 671791 • Letter: 3
Question
3.16 you have written an essay for school, and it has to be for at least five pages long.buy your essay is only 4.5 pages long ! you decide to use your new Python skills to make your essay longer buy spacing out the letters write a function that takes a string and the number of spaces to insert between each letter, then print out the resulting string.
>>> spaceitout (“It was a dark and stormy night”, 3)
It was a dark and stormy night
3.17 same problem as before, but you decide to use more of your python skills. you are going to increase this bases between the words. write a function that takes the a number of spaces to insert insert between each word. then print out the resulting string.
>>> spaceout (“It was a dark and stormy night”, 3)
It was a dark and stormy night
Using "JES Jython" how can I write it in python and make it look like the picture below?
Explanation / Answer
3.16
Requirement
write a function that takes a string and the number of spaces to insert between each letter, then print out the resulting string.
Answer
def spaceitout(string, number):
string = “It was a dark and stormy night”
number = "3"
word = “”
space = ” ”
for index in range(0,len(string)):
word = word+ string[index]+number*space
print word
3..17
Requirement
you are going to increase this bases between the words. write a function that takes the a number of spaces to insert insert between each word. then print out the resulting string.
Answer
def spaceitout(string, number):
string = “It was a dark and stormy night”
number = "3"
word = “”
space = ” ”
base = string.split()
for index in range(0,len(base)):
word = word+ string[index]+number*space
print word
This function prints spaces after every word, even the last one.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.