Please see my comment to the question. Anyway, I'll advise you what to do.
Doing your assignment for you would be pointless. It would be unfair, first of all, to your fellow students who do this work by themselves. Importantly,
it could disrupt your own education process, because your teachers may get wrong information on your actual progress and won't be able to correct their efforts accordingly.
So, here is the solution. You have two sound options: 1) work harder to solve the problem by yourself as well as possible; 2) come to your University adviser, or the head of your labs/seminars, or your lecturer on the topic and tell this person that you cannot cope with the assignment and explain why is that so, don't forget to explain
what have you tried so far. This person will be able to correct her/his teaching to take your problems into account and advice your what to do. Perhaps some part of lecture or seminar was not clear enough, so you will need some additional explanation, more likely, you will need to read some documentation, textbook or other literature on the topic.
Note that the problem, as you wrote it, is not correctly formulated. "Write every command" is unclear. P1 is a vector, so it's not defined what "bigger than" may mean for a vector. It could be the length of the vector (I hope you know how to calculate it) or something else.
—SA