# Quiz: Compute an Exponent

It’s your turn to import and use the math module. Use the math module to calculate e to the power of 3. print the answer.

Refer to the

# print e to the power of 3 using the math module

Write a function called generate_password that selects three random words from the list of words word_list and concatenates them into a single string. Your function should not accept any arguments and should reference the global variable word_list to build the password.

# TODO: First import the random module

# We begin with an empty word_list
word_file = "words.txt"
word_list = []

# We fill up the word_list from the words.txt file
with open(word_file,'r') as words:
for line in words:
# remove white space and make everything lowercase
word = line.strip().lower()
# don't include words that are too long or too short
if 3 < len(word) < 8:
word_list.append(word)

# It should return a string consisting of three random words
# concatenated together without spaces

# Now we test the function
print(generate_password())

words.txt

Alice
was
beginning
to
get
very
tired
of
sitting
by
her
sister
bank
having
nothing
Once
twice
she
peeped
into
the
book
her
sister
was
but
it
no
pictures
or
conversations
in
it
and
what
is
the
use
of
a
book
thought
Alice
without
pictures
or
conversations