Infosys interview question

How would you write to a file in Python?