Submitting your homework as a PDF allows it to be opened on any device, regardless of the operating system. Saving a file as a PDF is possible from most programs and locks the formatting, so you don’t have to worry about your file looking different when your professor opens the file on their computer.
Unless your professor requests a specific format for assignments, it is always a good idea to default to submitting assignments as a PDF!