Python will not print to a text file
<p>For some reason, the following code is unable to print to <code>Cache.txt</code> </p>

<pre><code>import random
import time

text_file = open("Cache.txt", "w")
text_file.write("Numbers Used \n")

print("Welcome to the Bingo number generator")
UserNumber = str((random.randint(1,90)))
print(UserNumber)
text_file.write ("UserNumber")
text_file.close
</code></pre>

<p>Can someone help me figure out what is wrong with this code?</p>