Instructions

In your breakout groups, please put the following code chunks in order so that the code runs. Each function is designed to process the following string object.

text = "An initial attempt to rescue the group, stranded in mountain refuge for two nights, was abandoned on Monday night because of smoke from the Creek Fire. But helicopters were able to land early on Tuesday and are have begun taking the hikers to safety. Fires in California have burned through a record 2m acres in recent weeks. In total, these blazes span an area larger than the US state of Delaware. California is currently experiencing an unprecedented heatwave."
print(text)
## An initial attempt to rescue the group, stranded in mountain refuge for two nights, was abandoned on Monday night because of smoke from the Creek Fire. But helicopters were able to land early on Tuesday and are have begun taking the hikers to safety. Fires in California have burned through a record 2m acres in recent weeks. In total, these blazes span an area larger than the US state of Delaware. California is currently experiencing an unprecedented heatwave.



Questions

(1) Piece together this function which counts the number of words in the text.

tmp = text.split(" ")
count = len(tmp)
def word_count(text):
return count



(2) Piece together this function which counts the number of unique words in the text.

def unique_words(text):
return count
count = len(a)
a = set(text)



(3) Piece together this function which counts up the number of times each word is used in the text.

word = word.replace(".","")
word = word.replace(",","")
if word in word_count.keys():
    word_count[word] += 1
word = word.lower()
for word in words:
else:
    word_count[word] = 1
words = text.split()
word_count = {}
return word_count
def usage_count(text):