Absolutely; however, one also still has to study. Just writing "bismillah al-rahman al-rahim" on top of an exam does not guarantee a good score. However you can ask Allah for help with studying and help on getting good marks, and then do your best. (Which also may include asking for help from other people if you are having difficulty with the material alone.)
True, rarely, there are miracles (for instance, there may be a case where someone is desperate to pass an exam and coincidentally studies the exact topic that is on the exam, and this can be ascribed to divine assistance at a critical point in their life). But in general the divine assistance should be coupled with serious efforts.
I am saying that because it is not unusual for some students who get low grades on an example to approach prayer as a last resort, and then wonder why they are getting low marks when they write "786" on their exam and all. Of course it is always good to begin everything with bismillah, it just isn't a substitute.
But yes it is always good to ask for Allah's help.
There is a nice story about the late 'Allamah Tabataba'i who wrote the famous Tafsir al-Mizan. It is hard to believe, but he says that in his youth he had a very difficult time with school and was written off by the teacher as being a poor student. So he went out of the city and implored Allah to give him the capability to study and learn. And as we see, he became one of the most famous scholars in history. This is an example we can all follow if what we are studying is important to us!
Also remember that sometimes if studying a subject doesn't work out, sometimes there is an element of fate, that is, maybe it isn't something we are meant to do as part of our life path. (For instance, if a person doesn't get into medical school) But of course if it is important to you, you should still try your best. God knows best.

