I tried using the code below to create a file but it didn't work when I tried to search it in my drive. Here is the link to my code if you need to see the full thing. https://colab.research.google.com/drive/1N436bntHOf146ZMGVBeSh5EXBuYAjvQY?usp=sharing
Here is the code I used to create and write a file.
output = open("sequences.fasta", "w")
output.writelines('>' + firstheader + '\n' + seq1 + '\n')
output.writelines('>' + secondheader + '\n' + seq2.upper() + '\n')
output.writelines('>' + thirdheader + '\n' + seq3.replace('-', '') + '\n')